Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapboxGL fails to turn off its own locationManager #1

Closed
christocracy opened this issue Aug 18, 2015 · 3 comments
Closed

MapboxGL fails to turn off its own locationManager #1

christocracy opened this issue Aug 18, 2015 · 3 comments

Comments

@christocracy
Copy link
Member

I've pointed out to the folks at MapBoxGL that their component fails to shut down their CLLocationManager from updating location when app goes to background.

While their component only asks for foreground location-updates, because react-native-background-geolocation asks for background-permission, theirs too will continue to run (at full GPS power) in background while mine tries to go to sleep in a stationary-geofence. Since theirs keep running, the entire app is prevented from suspending, rapidly draining the battery (and getting your phone pretty hot).

I sent a pull-request to fix the problem but the MapBox people have requested teh fix be applied further upstream, at MGLMapView.mm (the actual CLLocationManagerDelegate, isolated from react-native)

tl;dr Until I send a PR to the people at mapbox-gl-native, this demo will be horrible on battery-usage. This is not related to react-native-background-geolocation.

@jlebensold
Copy link

@christocracy what do you recommend as a mapping library for ios? Would it be possible to pull down a branch of this demo with a working map for iOS (even if you've forked the upstream dependencies)?

@christocracy
Copy link
Member Author

I've currently got Mapbox-gl running again. I hope to push an update this week.

I'm hoping my issue with mapbox-gl is solved since my first attempts months ago, where mapbox-gl doesn't take care to turn off their CLLocationManager instance in the background, was solved with iOS 9 (which requires a CLLocationManager instance to explicitly declare allowsBackgroundUpdates

This is very important, since my plugin declares the UIBackgroundMode: "location", if some other 3rd party code is also running a location-updates (such as MapBoxGL), even if their library didn't declare this background-mode, their CLLocationManager can continue running even though my library wisely turns its location-updates off when the device is determined to be stationary.

So, with iOS9, the problems associated with MapBoxGL's naivete should be solved.

@jlebensold
Copy link

ok sounds good!

amirey added a commit to Ridevu/rn-background-geolocation-demo that referenced this issue Jan 15, 2019
amirey added a commit to Ridevu/rn-background-geolocation-demo that referenced this issue Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants