-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Pause metrics-collection when app is suspended #2120
Pause metrics-collection when app is suspended #2120
Conversation
…nts continues to run its locationManager. Since Mapbox only requests WhenInUse authorization, if another module requests AlwaysUsage authorization, MGLMapboxEvents' locationManager will continue updating-location PREVENTING iOS FROM SUSPENDING THE APP. This puts a huge drain on the battery, of course.
Yes, this is correct @christocracy. If on the free plan, the trade is background location data collection. We have optimized things to be very conservative about the accuracy levels, etc. involved in this collection, so as to only obtain the highest resolution already otherwise collected on the system. "Preventing iOS from suspending the app" sounds worse than it is, since GL resources, etc. will still be jettisoned when the app is backgrounded. "Huge drain on the battery" is subjective; yes, it is relatively more than no drain on the battery, but should not be huge. You can read more about this at https://www.mapbox.com/blog/optimizing-battery-ios/ Lastly, your PR does not ever call |
I have over 2 years experience developing a sophisticated cross-platform location-manager library which is designed to constantly track a device while running in the background. Guess what happens when an app enables the Mapbox must not keep its |
It's frankly irresonsible, naïve and neglectful to the community for mapbox-gl-native to not take better care in ensuring its CLocationManager can be subordinated to another library with more built-in intelligence upon the movement-state of the device, allowing it to express its desire to allow iOS to suspend the app while running in background. |
In fact, this kind of behavior could certainly be grounds for Apple declining an otherwise well-behaved application. |
Furthermore, I mean no offence to you personally, but the information in this URL, is simply laughable. I'm sorry to be so harsh. |
Further-furthermore (last one): How can Optimizing Battery for iOS be taken seriously when it's found using the old deprecated iOS6-era |
Hey guys, seems to be like this could be wasting battery? Is there a way to fix the pull request so that it can be merged? Seems like the guy who wrote the library on background geo probably knows a bit about it's battery use! |
I know everything there is to know about battery consumption of I highly recommend user's avoid Mapbox GL until they acknowledge and fix On Wednesday, October 7, 2015, Andrew Phillipo notifications@github.com
Snet form Gmail Mobile |
Any updates on this? |
Thankfully iOS 9 now requires a There's no reason MapBoxGL should ever declare |
Pause metrics-collection when app is suspended otherwise
MGLMapboxEvents
continues to run its locationManager. SinceMapbox
only requestsNSLocationWhenInUse
authorization, if another module (like mine, for instance) requestsNSLocationAlwaysUsageDescription
authorization, and enables thelocation
in Background Modes:MGLMapboxEvents
'locationManager
will continue updating-location, even when the app is suspended preventing iOS from suspending the app.This puts a huge drain on the battery, of course, not only since the location-manager is running but because the app is prevented from suspending.