Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

location accuracy is undefined even though TS says it will never be undefined #2218

Closed
wmonecke-gen opened this issue Nov 27, 2024 · 3 comments
Labels

Comments

@wmonecke-gen
Copy link

image

Your Environment

  • Plugin version:
  • Platform: iOS or Android
  • OS version:
  • Device manufacturer / model: iOS
  • React Native version (react-native -v): 0.74.2
  • Plugin config
  const config: Config = {
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_MEDIUM,
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      distanceFilter: 20,
      // Activity Recognition
      stopTimeout: 5,
      stopOnTerminate: false,
      startOnBoot: true,
      enableHeadless: true,
      allowIdenticalLocations: false,
      disableElasticity: true,
    };

Expected Behavior

accuracy to be defined

Actual Behavior

accuracy is undefined and crashing the app

Can accuracy be undefined?

@christocracy
Copy link
Member

It’s not likely accuracy which is undefined but a LocationError object being provided to the onLocation handler instead of the expected Location object.

if you observe your logs, you should see a ⚠️ about not providing a 2nd arg locationErrorCallback to the onLocation method.

see the API docs .onLocation to learn about the 2nd argument.

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 28, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants