transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.64k stars 425 forks source link

iOS Background location popup keeps on appearing when locationAuthorizationRequest: 'Always' is configured #1556

Closed Shubhangigovil closed 4 months ago

Shubhangigovil commented 2 years ago

Expected Behavior

I want the app to track the location when it is in background, foreground or quit mode. And it should ask for location permission when the permission "Always" is not granted. But there is no option for configuring the Always Allow settings in iOS and neither does the OS send it by itself as described in your docs: https://transistorsoft.github.io/react-native-background-geolocation/interfaces/config.html#locationauthorizationalert

Actual Behavior

After every 1 min it gives me this popup: Simulator Screen Shot - iPhone 13 - 2022-10-05 at 14 23 43

christocracy commented 2 years ago

But there is no option for configuring the Always Allow

You didn’t not correctly follow the iOS Setup. You made a mistake adding the .plist strings NSLocationAlwaysAndWhenInUseUsageDescription.

imjamescrain commented 1 year ago

@Shubhangigovil for what it's worth, I was having the same issue even with the proper .plist strings added. I had to add locationAuthorizationRequest and set it to WhenInUse inside of the BackgroundGeolocation.ready({...}) config.

See this thread: https://github.com/transistorsoft/capacitor-background-geolocation/issues/14#issuecomment-902769420

Example:

 BackgroundGeolocation.ready({
      ...
      locationAuthorizationRequest: 'WhenInUse',
      ...
 })

Hope it helps ...

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 4 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.