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

Enable always location permissions and background location #190

Closed
friedbunny opened this issue Dec 16, 2015 · 5 comments
Closed

Enable always location permissions and background location #190

friedbunny opened this issue Dec 16, 2015 · 5 comments
Labels

Comments

@friedbunny
Copy link
Contributor

Mapbox terms of service and mobile telemetry require that always location permissions be granted and background location be enabled for most developers' apps.

On iOS, this is blocked by facebook/react-native#1506 — react-native currently will only ever ask for whenInUse permissions.

/cc @bsudekum @mapbox/mobile

@rmevans9
Copy link

Technically you can use always location permissions... just not with React-Native's geolocation implementation. You can however use third party ones like https://github.com/timfpark/react-native-location. The catch is in the JS side of things you will not be able to execute code while the screen is off (due to the bug you point out). However since Mapbox is actually running natively anything that it does internally upon location updates can still execute it just won't trigger any calls across the RN bridge meaning any custom logic a user may have on location updates won't execute.

Given that Mapbox's internal location update logic would be executing does that meet the requirements of the ToS and mobile telemtry?

@1ec5
Copy link
Contributor

1ec5 commented Dec 17, 2015

Requesting always access is one thing, but the request will never succeed unless NSLocationAlwaysUsageDescription is set in the Info.plist. Even native code won’t run unless background location is enabled for the application (again via Info.plist).

@rmevans9
Copy link

What is preventing you from adding that to the info.plist? I have added that and it works as expected.

@dapetcu21
Copy link
Collaborator

Is this still the case? I can't find that requirement in the ToS. Also, from the iOS docs:

In order to show the user’s position on the map, you must first ask for their permission. In iOS 8 and above, this is accomplished by creating and setting the NSLocationAlwaysUsageDescription and/or NSLocationWhenInUseUsageDescription keys in the Info.plist file.

Which leads me to believe it's acceptable to just use NSLocationWhenInUseUsageDescription.

@1ec5
Copy link
Contributor

1ec5 commented Jul 23, 2016

You’re correct, our ToS has changed since the issue was originally filed. Furthermore, the upstream issue was fixed in facebook/react-native#5093.

@1ec5 1ec5 closed this as completed Jul 23, 2016
emerson233 pushed a commit to studyroz/react-native-mapbox-gl that referenced this issue Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants