Same issue explained in this video: https://vimeo.com/182377692. No issue with Android, only iOS.
We are using: mirrorcell:background-geolocation-plus.
There are 4 status:
- foreground - device running
- foreground - device locked
- background - device running
- background - device locked
The fourth status is where web socket connection is dropped till app is in foreground status again.
I’ve opened an issue on mirrorcell:background-geolocation-plus GitHub account.
Another plug-in (not running at this moment) zero asterisk:cordova-geolocation-background is based on rest operation and was able to contact the server and pass updated data. Here we have a disconnect and not reconnect probably due to a not authorized upgrade from HTTP to WebSocket connection. There is another strange thing: on iOS WKWebView use a local WebServer to avoid direct access to file system (Safari sandbox). When Cordova goes in background web server is stopped. It’s odd to note that if the app was in foreground status before lock connection is not dropped, and if it’s dropped (after 30 second of “no-ping” from client), then Meteor can reconnect. Instead if app is in background and device is locked, connection is dropped suddenly and Meteor can’t reconnect successfully. If you try, you’ll see “disconnected” or “connecting”, but never “connected” (from Debugger using Meteor.status())