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.

Not working when App closed (Android)

See original GitHub issue

My BackgroundGeolocation configure :

 BackgroundGeolocation.configure({
      desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY,
      stationaryRadius: 50,
      distanceFilter: 50,
      notificationTitle: 'Background tracking',
      notificationText: 'enabled',
      debug: false,
      startOnBoot: false,
      stopOnTerminate: false,
      locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER,
      interval: 10000,
      fastestInterval: 5000,
      activitiesInterval: 10000,
      notificationsEnabled:true,
      url: 'http://192.168.81.15:3000/location',
      httpHeaders: {
        'X-FOO': 'bar'
      },
      // customize post properties
      postTemplate: {
        lat: '@latitude',
        lon: '@longitude',
        foo: 'bar' // you can also add your own properties
      }
    });

 BackgroundGeolocation.on('location', (location) => {
      console.log('[ERROR] BackgroundGeolocation ', JSON.stringify(location));
       Alert.alert("Get Location"+ JSON.stringify(location))
});

Not getting location values when the android application is closed not trigger any action in react native side.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

5reactions
lyseihacommented, Aug 4, 2020

any update?

2reactions
dhananjay23commented, May 22, 2020

I will check BackgroundGeolocation.stop() not place anywhere and Foreground notification is also enabled in android but not get location values in BackgroundGeolocation.on('location', (location)) method.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Service Stops When App Is Closed - Stack Overflow
The Main problem is in unable to start the service when app closed, android OS(In Some OS) will kill the service for Resource...
Read more >
Fix an installed Android app that isn't working - Google Support
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
Android push notification not working when the app is closed
After some research, all I got to know is that for some device if the background task is taking to much of your...
Read more >
Why do my apps keep crashing on Android, How to fix it
How to fix apps that keep crashing on Android · 1. Force stop the app · 2. Restart the device · 3 ....
Read more >
How to force close apps in Android - Digital Trends
If your smartphone has a single horizontal line and uses a swipe-gesture system to navigate, swipe up from the bottom to the middle...
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