react-native-background-geolocation: Android - timestamps with wrong year and time are getting posted.

Your Environment

  • Plugin version: 3.4.2
  • Platform: Android
  • OS version: Android 10
  • Device manufacturer / model: it is happening at customer side would need to ask them about exact information if required.
  • React Native version (react-native -v): 0.62.2
  • Plugin config
{
    debug: false,
    logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
    desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
    stopOnTerminate: false,
    enableHeadless: Platform.OS === 'android' ? true : false,
    foregroundService: Platform.OS === 'android' ? true : false,
    preventSuspend: Platform.OS === 'android' ? false : true,
    heartbeatInterval: 60,
    startOnBoot: true,
    locationAuthorizationAlert: {
      titleWhenNotEnabled: translations.titleWhenNotEnabled,
      titleWhenOff: translations.titleWhenOff,
      instructions: translations.instructions,
      cancelButton: translations.cancel,
      settingsButton: translations.settings,
    },
    distanceFilter: Platform.OS === 'ios' ? 50 : 0,
    locationUpdateInterval: 60000,
    batchSync: true,
    autoSync: true,
    maxBatchSize: 10,
    autoSyncThreshold: Platform.OS === 'ios' ? 10 : 5,
    notification: {
      title: translations['lastGps'],
      text: translations['startGpsTracking'],
    },
   url: `${BASE_URL}/transports/${transportId}/gps/batch`,
      method: 'PUT',
      headers: {
        token: token,
      },
      httpRootProperty: '.',
      locationTemplate:
        '{"lat":<%= latitude %>,"lng":<%= longitude %>,"positionAccuracyError": <%= accuracy %>, "atd": "<%= timestamp %>" }',
      extras: {
        driverId: `${code}${driverId}`,
      },

Expected Behavior

It should send the current timestamp of the system.

Actual Behavior

it is sending timestamp like this “2001-02-14T16:50:36.000Z”

Context

We are just using the location service and sending the GPS signals as configured above in a batch.

Debug logs

Logs

Currently, I don’t have the logs as this is happening at the customer side in production. Would it be possible to tell what is happening without the logs?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

I actually got a friend’s kid (the friend was testing my app so had it installed) in trouble by mentioning it when we first saw it. The friend had no idea the kid was trying to hack around things, ha. Good luck