transistorsoft / capacitor-background-geolocation

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
MIT License
96 stars 15 forks source link

iOS Location Services Prompt #288

Open v-mauna opened 4 weeks ago

v-mauna commented 4 weeks ago

Ionic React Capacitor App All latest versions of all dependencies.

When testing on the iPhone 16 Pro running 18.0.1, and using the latest plugin of 6.1.2, the same prompt is shown when the device's location services are off and the app's location permissions are turned off. It requires deleting and reinstalling the app to trigger the correct prompt for the device's location services. Is there a way to update the config for the plugin to determine which is the correct prompt to show?

Current Plugin Config: { distanceFilter: 10, stopTimeout: 5, locationAuthorizationRequest: 'Always', desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, logLevel: BackgroundGeolocation.LOG_LEVEL_INFO, backgroundPermissionRationale: { title: "Allow MAS Trips to access to this device's location in the background?", message: 'In order to track location changes in the background, please enable background location access.', positiveAction:Change background location access to Always?, }, preventSuspend: true, // TODO: [iOS Only] this can stay true since we are turning the plugin on and off based on active rides }

christocracy commented 4 weeks ago

You don’t have to delete your app. Just go to your App settings and change location permission “Ask Next Time”.

IMG_2386

v-mauna commented 4 weeks ago

The issue I'm seeing is that when the app's permissions are set to "Always" but the location services for the device are off, the prompt displayed reads: Location Services Are Off. To use background location, you must enable 'Always' in the location services settings. After deleting, it will show the alert specific to the device's location services, not the app's permissions.

christocracy commented 4 weeks ago

The OS gives your app only one chance to show the native dialog to select permission.

thereafter, it will never be shown again until you select “Ask Next Time”.

christocracy commented 4 weeks ago

See api docs Config.locationAuthorizationAlert