react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

iOS defaults to "When in Use" instead of "Always"

Open lucidtheory opened this issue 8 years ago • 4 comments

Your Environment

  • Plugin version: 2.11
  • Platform: iOS
  • OS version: Mac OS High Sierra
  • Device manufacturer / model: Any iPhone version
  • React Native version (react-native -v): .54
  • Plugin config:
      desiredAccuracy: 0,
      distanceFilter: 5,
      disableElasticity: true,
      activityRecognitionInterval: 500,
      elasticityMultiplier: 0.5,
      stopTimeout: 400,
      activityType: "AutomotiveNavigation",
      debug: false,
      logLevel: BackgroundGeolocation.LOG_LEVEL_OFF ,
      stopOnTerminate: true,
      preventSuspend: true,
      heartbeatInterval: 60,
      startOnBoot: true,
      foregroundService: true,
      locationAuthorizationRequest: "Always",
      schedule: [
        '1-7 10:30-21:30',   // Sunday-Sat: 10:30am-9:30pm
      ]

Expected Behavior

When App loads it should ask user for "Always Use" permission

Actual Behavior

App asks for "When in Use" permission. User has to leave app and go to settings and turn it on manually.

Steps to Reproduce

Following installation instruction. In info.plist I added: -Privacy When in Use -Privacy Always -Privacy Always and When in Use

I think this is similar to #282

lucidtheory avatar Mar 17 '18 02:03 lucidtheory

You’re using a map component (eg react-native-maps), right?

What does that map component do when it happens to be the first component to request location authorization from the user? It requests “When in Use”.

christocracy avatar Mar 17 '18 05:03 christocracy

Ok, I see that there is an open pull request on react-native-maps with a similar problem:

https://github.com/react-community/react-native-maps/pull/1184

lucidtheory avatar Mar 17 '18 15:03 lucidtheory

It's not a problem, really. Just make sure you don't set the MapView property showsUserLocation until after you've told the BackgroundGeolocation plugin to #start.

christocracy avatar Mar 17 '18 15:03 christocracy

Oh ok, I havent used that key before. I will try it out. Thank you

lucidtheory avatar Mar 17 '18 15:03 lucidtheory