Plugin Not working In background Mode (ionic 3)
See original GitHub issueYour 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top GitHub Comments
not sure if this is related: If I use url: ‘server.tld:port’ I keep receiving data (the object is inside an array though) What basically stops working in background is the callback
this.backgroundGeolocation.on(BackgroundGeolocationEvents.location).subscribe((location: BackgroundGeolocationResponse) => {
@tlacroix thanks a lot, sorry I didn’t write before but I also found this posts and it works well now 👍