-
Notifications
You must be signed in to change notification settings - Fork 694
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
Updating user-location in background #77
Comments
I think this looks good. @christocracy want to make this into a PR? |
I'll clean it up, add required logic and do a PR. On Monday, August 10, 2015, Bobby Sudekum notifications@github.com wrote:
Snet form Gmail Mobile |
@christocracy The place to submit this fix would be upstream in mapbox/mapbox-gl-native, sticking it someplace in platform/ios/MGLMapView.mm. |
Ok, I'll swim upstream then. |
I realise this might be old but incase anyone might have missed this, I feel I should put it out there... This does work but only if the user agrees to Location Permission request before... When testing this method (Using Swift 1.2, iOS 8, XCode 6, iPhone 6), I get the Permission Request window opening up continuously every second. open close open close etc. Anyone else had this issue? |
@byroncoetsee confirmed, I can take a look at this bug this weekend. |
I've created a sophisticated background-geolocation plugin (ported from my popular Cordova plugin which intelligently monitors the user's movement-state and only engages
locationManager
when device is determined to be moving (and stopslocationManager
when the device has stopped).Because my plugin sets
NSLocationAlwaysUsageDescription
,react-native-mapbox-gl
will keeplocationManager
updating the location even when the device goes to the background, which kills the battery in a short time, of course. This is what my plugin resolves.In spite of what this link says.
After over 2 years experience creating Android/iOS background geolocation code, keeping
locationManager
always running in background WILL certainly kill the battery in a very short time.This is what my plugin resolves.
A simple (very raw) solution in
RCTMapboxGL.m
goes like this:The text was updated successfully, but these errors were encountered: