react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Location not updating on server when app enters stationary when app is in background or is closed

Open m-tbox opened this issue 4 years ago • 5 comments

Hello @mauron85

Environment:

  • React Native version: 0.59.9
  • Plugin version: 0.6.3
  • Platform: Android
  • OS version: 7
  • Device manufacturer and model: Redmi Note 4
  • Plugin configuration options:
BackgroundGeolocation.configure({
      desiredAccuracy: 10,
      stationaryRadius: 10,
      distanceFilter: 5,
      notificationTitle: 'Background Tracking',
      notificationText: 'Enabled',
      debug: true,
      startOnBoot: true,
      stopOnTerminate: false,
      locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,
      interval: 5000,
      url: url,
      syncUrl: url,
      httpHeaders: {
        ...this.props.headers
      },
      postTemplate: {
        lat: '@latitude',
        long: '@longitude',
        id: id` // you can also add your own properties`
      }
    })

Location updates correctly when app is in foreground or when sent to background while user is moving but if app goes into stationary region while app is closed or is background location stops to update. Even if I travel distance once app goes to stationary region from background or terminate state it does not exit stationary region and stops updating location on server.

m-tbox avatar May 19 '20 10:05 m-tbox

Facing the same issue, can you please help

Punit-Vajpeyi avatar Jun 08 '20 13:06 Punit-Vajpeyi

Did you try this?

bsor-dev avatar Jun 30 '20 03:06 bsor-dev

Any update? Same issue for iOS.

artmerlop avatar Sep 28 '20 05:09 artmerlop

i get same issue in real device ios, android 10

thuynt99 avatar Jan 08 '21 03:01 thuynt99

Hi, I'm getting the same problem. It seems like battery saver in android phones causing this. My phone is mi 10 lite and i followed this https://dontkillmyapp.com/xiaomi and now it is working fine. But how to prevent battery saver in react native to prevent this from happening?

clarissacarcha avatar Feb 05 '21 03:02 clarissacarcha