Skip to content

Odometer Accurate on Emulator but Inconsistent on Real Device #2425

@AnasEspl

Description

@AnasEspl

Required Reading

  • Confirmed

Plugin Version

4.19.0

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Vivo v29e

Device operating-systems(s)

Android 15

React Native / Expo version

0.71.8

What do you require assistance about?

The odometer value is accurate on the emulator (Extended Controls), but on a real device it sometimes shows incorrect Odometer readings.

[Optional] Plugin Code and/or Config

await BackgroundGeolocation.ready({
      reset: false,
      debug: false,
      logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
      desiredAccuracy: accuracy,
      distanceFilter: 10,
      stopTimeout: 5,
      locationAuthorizationRequest: 'Always',
      autoSync: true,
      maxDaysToPersist: 14,
      stopOnTerminate: false,
      startOnBoot: true,
      enableHeadless: true,
      notification: { title:'', text:'', channelName:'SilentTracking', channelImportance:0, priority:-2, sticky:true },
    });      


 BackgroundGeolocation.getState().then(state => {
        setIsTracking(state.enabled);
        setOdometer(state.odometer || 0);
      });

[Optional] Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions