-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MGLMapView operating in the background #1892
Comments
Part of setting up Mapbox GL is registering for background location updates that power your account’s location analytics dashboard. Enabling background metrics is required as long as you use Mapbox-hosted tiles with a free Starter plan. End users may turn off Mapbox Metrics in your application’s page in Settings. The crash is #1460, which is fixed on master and will make it into the next release. |
We've done some fairly extreme battery testing on iOS around metrics so far, but if we're falling down on battery life or data usage that is something we'll fix. Have your users happened to give you hard numbers on background data usage, @quicklywilliam? |
@friedbunny My understanding is that on iOS , OS terminates all network activity when the app goes to background (It consistently does this on my wifi only iPhone as well as iPad). So any data usage has to happen when the app is in foreground. Is there some way to track data usage for an app on a wifi only iOS device? Mapbox GL test app does not even show up under "Cellular Usage" on my wifi only test device. It would be good to track this number since it might expose performance bugs with caching or just large vector tiles. |
@friedbunny we're seeing it in the form of battery drain. The numbers we track probably for cell battery usage (using this: https://gist.github.com/quicklywilliam/842859749c5d78251a77) probably won't mean a lot to you, but suffice it to say that usage went from nothing or very little to higher than I have ever seen. |
@1ec5 good to know. I'm concerned about this, mostly because CoreLocation is a black box and it is extremely difficult for us to debug background location issues (a key component of our app). For example, other apps using location or running in the background can cause our app to fail to defer GPS updates, greatly increasing battery usage. At least for development, I'd like to turn off Mapbox background metrics to isolate the variables. I went ahead an upgraded to the basic plan. Is there anything else I need to do? Note that our app already registers for background location updates. |
@quicklywilliam, please get in touch with mobile@mapbox.com for the next steps. Thanks! |
I will like to know the best way to turn off the metrics in background mode (we have the premium plan). We need to add the capabilities for location updates in background mode and the current api keep using the background mode forever... the client show the blue bar on the top in background mode (the app is using the location service) |
Hi @crazyBoat, please email us at mobile@mapbox.com and we'll help you out. |
after upgrade to 0.5 the app keep working in background mode if you disable metrics+set showUserLocation:NO - suggestions to stop updating the user location in background mode? |
This is a strange one. Since switching to MGLMapView from MBXMapView, we've seen two new issues:
In addition, some crashes show something like this in the trace buffer:
Our app runs extensively in the background using locations services. My educated guess is that something in the map view is making background requests, but I don't know how that's cause a crash. This is on the latest (0.5.1) release, across a variety of devices running iOS 8 and iOS 9.
The text was updated successfully, but these errors were encountered: