-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin Not working In background Mode (ionic 3) #720
Comments
The application stopped programming due to this problem .. any ideas to solve it ... |
It may be that the app needs authorization for background data. See: https://www.samsung.com/hk_en/support/mobile-devices/how-do-i-restrict-background-data/ |
I have the same problem, the app has authorization to work in the background and the battery optimization is disabled, even so it stops saving locations or updating them by url. |
I've also installed these CORDOVA plugins and I've better result: IONIC : and @ionic-native/power-management |
I'm currently debugging this. It seems for me that in android 9 background location is still working. In the simulator for android 10 & 11 I can only give location permissions to "while app is running" and not in the background all the time. Am I missing something? |
@tlacroix thanks a lot, sorry I didn't write before but I also found this posts and it works well now 👍 |
not sure if this is related:
|
Your Environment
Plugin version: 3.0.0-alpha.50
Platform: Android
OS version: 7.1.4
Running in Simulator: No
Cordova version :8.1.1
Plugin configuration options:
const bgGeolocationConfig: BackgroundGeolocationConfig = {
desiredAccuracy: 10,
stationaryRadius: 20,
distanceFilter: 5,
interval: 5000,
debug: false, // enable this hear sounds for background-geolocation life-cycle.
stopOnTerminate: false, // enable this to clear background location settings when the app terminates
stopOnStillActivity: false,
startOnBoot: true,
maxLocations: 500,
url:
${this.appConfig.apiUrl}/locate
,httpHeaders: {
'Accept': 'application/json',
'Authorization':
Bearer ${this.currentToken}
,'Content-Type': 'application/json'
},
// customize post properties
postTemplate: {
latitude: '@latitude',
longitude: '@longitude',
}
};
Context
It work perfectly in the foreground but in the background when we close the App the server is not receiving any request from the plugin
The text was updated successfully, but these errors were encountered: