react-native-background-geolocation: Background tracking doesnt work after android phone reboot in 0.5.0-alpha.50

Hi. Background tracking isn’t started on android after phone reboot in version 0.5.0-alpha.50, but it works fine in 0.5.0-alpha.48. I think it was broken in this commit. mauron85/background-geolocation-android@aa0f20e

Your Environment

  • Plugin version: 0.5.0-alpha.50
  • Platform: Android
  • OS version: 6.0
  • Device manufacturer and model: sony xperia x dual
  • Running in Simulator: No
  • React Native version: 0.55.0
  • Plugin configuration options:
{
  desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY,
  stationaryRadius: 5,
  distanceFilter: 5,
  debug: false,
  startOnBoot: true,
  startForeground: true,
  stopOnTerminate: false,
  locationProvider: Platform.select({
    android: BackgroundGeolocation.ACTIVITY_PROVIDER,
    ios: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,
  }),
  fastestInterval: 3000,
  activitiesInterval: 5000,
  stopOnStillActivity: false,
  maxLocations: 50000,
  url: `${config.baseUrl}/track`,
  postTemplate: {
    latitude: "@latitude",
    longitude: "@longitude",
    altitude: "@altitude",
    timeUTC: "@time",
    accuracy: "@accuracy",
    speed: "@speed",
  },
  interval: 10000,
  syncUrl: `${config.baseUrl}/track-sync`,
  syncThreshold: 25,
  httpHeaders: {
        Authorization: `Bearer ${token}`,
        "app-version": VERSION,
   },
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (3 by maintainers)

Most upvoted comments

I have tested another time on android 6 (sony xperia x dual). It woks in 0.5.0-alpha.48 and doesnt work in 0.5.0-alpha.50. Http post request isnt send and there isn’t service’s notification after reboot. @mauron85 Could you reproduce it? I think it was broken in this commit. https://github.com/mauron85/background-geolocation-android/commit/aa0f20e26056a8f74c93cbbf77a9ae970b303587

src/preoreo/java/com/marianhello/bgloc/BootCompletedReceiver.java Intent locationServiceIntent = new Intent(context, LocationServiceImpl.class);

you can use previous deprecated npm package to install this version. https://www.npmjs.com/package/react-native-mauron85-background-geolocation