No location in background on iOS when authorization is "WhenInUse"
See original GitHub issueYour Environment
- Plugin version: 2.3.6
- Platform: iOS
- OS version: 12.1
- Device manufacturer and model: iPhone 6S
- Running in Simulator: No
- Cordova version (
cordova -v
): 8.0.0 - Cordova platform version (
cordova platform ls
): cordova-ios 4.5.5 - Plugin configuration options:
var config = {
PauseLocationUpdates : false,
desiredAccuracy: 0,
stationaryRadius: 5,
distanceFilter: 5,
debug: false,
stopOnTerminate: true,
interval: 3000,
notificationTitle: 'Coach AAC',
notificationText: 'Trajet en cours',
fastestInterval: 1000,
useActivityDetection: false
};
- Link to your project: N/A
Context
I need to retrieve locations when the app is in background. It works well on iOS when I select the “Always” authorization but I would like to use the “WhenInUse” because with this mode, a notification is displayed on screen in background.
Retrieving locations in background with the “WhenInUse” authorization works fine with Christocracy plugin but not with your plugin. The blue notification is display for few seconds when I put the application in background but no location is given by the plugin. Then , the notification disapears and I still don’t get any location (in background).
Do you have any idea to make this configuration works or do you know if there any other solution to use the “Always” authorization and having a notification ?
Expected Behavior
background notification saying that the gps is in use
Actual Behavior
(WhenInUse authorization ) : Notification for few seconds and then and no position retrieved in background (Always authorization ) : No notification but get normal locations in background
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (2 by maintainers)
Top GitHub Comments
Thanks for your quick answer. Yes but it was working in background, with this authorization, with the Christocracy plugin. I don’t know how it was possible, but it allowed me to have the notification.
Do you have any idea of how I could retrieve locations in background (with the “Always” auth) and still have a blue notification displayed ?
This issue has been automatically closed, because it has not had recent activity. If you believe this issue shouldn’t be closed, please reopen or write down a comment requesting issue reopening with explanation why you think it’s important. Thank you for your contributions.