Always show location in use indicator when integrating with Mapbox iOS SDK even hide our app
SpeedX app wants to use location all the time (foreground and background), it will use location to record the stroke when the user is in bicycle riding. They don't want to show the indicator when the app doesn't use location. @pveugen @1ec5 @friedbunny Is there any way SpeedX app can control the Mapbox iOS SDK using location service (not only the iOS location usage permissions)?
Mapbox SDK version: 3.2.2
iOS system gives two choices about the location usage types, as below:
NSLocationAlwaysUsageDescription Now SpeedX uses this to forbid the big blue bar shows on top of the iPhone screen when using location.
NSLocationWhenInUseUsageDescription It will cause iOS system showing blue bar on top of the screen when using location. Previous SpeedX uses it, but now they won’t show blue bar, so abandon this choice.
@xinnong @KarenZZhang @ChenJian345
When your app requests NSLocationAlwaysUsageDescription permissions, the Mapbox SDK listens to location updates generated by iOS to improve OpenStreetMap (more info). The data collection will automatically hibernate and is optimized to have very minimal impact. We worked together with third-party developers to reduce our footprint as much as possible. Don’t hesitate to reach out if you notice anything out of the ordinary.
@friedbunny If users press the stop bicycle riding button (even if the device is in motion and the user grants the app always permission), the app will stop collecting location data. If users press the start bicycle riding button (even if the app is in the background), the app will start collecting location data. I think the hibernation mode doesn't meet the demands above. If users see the using location arrow icon in status bar and the app isn't in bicycle riding status, they'll be nervous for private data leakage and try to uninstall the app.
cc @chenjian345
Unfortunately we don’t have control over the status bar arrow and it will appear when your app is using NSLocationAlwaysUsageDescription.
Adding both permission request strings to your info.plist will give users the option to either pick “always” or “when in use”.
Offering both doesn’t remove the blue bar or the location status icon in the status bar, but it gives users who are more conscious about location services the best and most transparent way to control location updates. Apps like Strava have implemented their iOS permissions in this sort of way.
cc @chenjian345