Skip to content

[Help Wanted]: How to get stationary intervals properly #2619

Description

@FazilMuhammed299

Required Reading

  • Confirmed

Plugin Version

4.19.2

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Oneplus 6s, Iphone 15 pro mx

Device operating-systems(s)

iOS 18.1 , android 14

React Native / Expo version

0.81.4

What do you require assistance about?

how can get proper stationary intervals what kind configuration I need improved

[Optional] Plugin Code and/or Config

let configDefault = {
    disableMotionActivityUpdates: false,
    activityRecognitionInterval: 10000,
    stopAfterElapsedMinutes: end_of_tracking ? stopAfterElapsedMinutes : 720,
    stopTimeout: 2,
    speedJumpFilter: 20,
    distanceFilter: 50,
    stationaryRadius: 25,
    desiredOdometerAccuracy: 30,
    desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_NAVIGATION,

    disableElasticity: true,
    heartbeatInterval: 300,
    preventSuspend: true,
    foregroundService: true,
    notification: {
      title: 'Live tracking enabled',
      text: 'Location service activated',
      smallIcon: 'drawable/ic_stat_onesignal_default',
      priority: BackgroundGeolocation.NOTIFICATION_PRIORITY_HIGH,
      sticky: true,
    },
    debug: true,
    logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
    disableProviderChangeRecord: true,

    showsBackgroundLocationIndicator: true,
    pausesLocationUpdatesAutomatically: false,

    locationAuthorizationRequest: 'Always',
    backgroundPermissionRationale: {
      title: 'Background Location Access',
      message:
        'As per the configurations, you need to enable the background location for the check-in/out. You can enable it by selecting {backgroundPermissionOptionLabel} from the location permission',
      positiveAction: 'Change to {backgroundPermissionOptionLabel}',
      negativeAction: 'Cancel',
    },

    maxDaysToPersist: 1,
    stopOnTerminate: false,
    startOnBoot: true,
    enableHeadless: true,

    url: `${endpoint}/geolocation/api/v2/real-time-tracking/`,
    headers: {
      Accept: 'application/json',
      'X-DTS-SCHEMA': `https://${domain}`,
      appVersion: appVersion,
      uniqueDeviceId: uniqueId,
      origin: `https://${domain}`,
    },
    autoSync: true,
    locationsOrderDirection: 'ASC',

    maxBatchSize: 5,
    batchSync: true,
    autoSyncThreshold: 5,

    params: {
      employeeId: id,
      employeeCode: empCode,
    },

    authorization: {
      strategy: 'JWT',
      accessToken: token,
      refreshToken: refreshToken,
      refreshUrl: `${endpoint}/api/token/refresh-with-expiry/`,
      refreshPayload: {
        refresh: '{refreshToken}',
      },
      refreshHeaders: {
        'Content-Type': 'application/json',
        'X-DTS-SCHEMA': `https://${domain}`,
      },
      expires: 3600,
    },
    scheduleUseAlarmManager: true,
  };

[Optional] Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions