question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin Not working In background Mode (ionic 3)

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
bogomipscommented, Jan 3, 2021

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) => {

0reactions
tobikacommented, Nov 20, 2020

@tlacroix thanks a lot, sorry I didn’t write before but I also found this posts and it works well now 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

BackgroundMode not working as expected - Ionic Framework
I have run into an issue here. I need to update the location of the device to my firebase database every 5 seconds...
Read more >
Background mode is not working in ionic 5 - Stack Overflow
Try this: ionic cordova plugin add cordova-plugin-background-mode npm install @ionic-native ...
Read more >
[Background Location Plugin] How to get ... - OutSystems
I want to use the Background Location plugin for an app I am developing, but I can't even get the Background Location Sample...
Read more >
cordova-plugin-background-mode-xjp - npm
The plugin is not enabled by default. Once it has been enabled the mode becomes active if the app moves to background. cordova.plugins....
Read more >
Keep Running Ionic 5/Angular Apps In Background Mode ...
We can solve the problem using the Cordova/Ionic Native background mode plugin which can be used in many cases such as: Backgound geolocation ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found