question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration to SDK29 seems to be causing background geolocation issues

See original GitHub issue

Your Environment

  • Plugin version: 0.6.3
  • Platform: Android
  • OS version: Android 10
  • Device manufacturer and model: PixelA3
  • Running in Simulator: YES (And real device too)
  • React Native version: 0.62.2
  • Plugin configuration options:
{
    desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY,
    fastestInterval: 20 * SECOND,
    interval: 20 * SECOND,
    activitiesInterval: 5000,
    distanceFilter: 50,
    stationaryRadius: 50,
    activityType: 'AutomotiveNavigation',
    startForeground: true,
    postTemplate,
    // @ts-ignore
    syncThreshold: 50,
  }
  • Link to your project: Private sources

Context

I had to migrate from SDK28 to SDK29 on Android, and it looks like since i migrated, the background geolocation isn’t working anymore.

Expected Behavior

It should work ok

Actual Behavior

It seems to only be working when the app is in the foreground

Possible Fix

It looks like the foreground service isn’t working, I don’t know why.

Steps to Reproduce

  1. Create a new React Native App
  2. Added this library
  3. Migrate to SDK29
  4. See the background geolocation fails

Context

Debug logs

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13

github_iconTop GitHub Comments

2reactions
Daavidaviidcommented, Aug 4, 2020

I think it would be nice if this library was added to https://github.com/react-native-community @react-native-community

1reaction
henriquebk1commented, Jul 22, 2020

Did you request this permission? android.permission.ACCESS_BACKGROUND_LOCATION

https://developer.android.com/about/versions/10/privacy/changes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration to Androidx · Issue #693 · mauron85/cordova-plugin ...
Hi Team, I am trying to migrate the plugin to androidx but not able to do it. I have tried jetifier and androidx-adpater...
Read more >
Geolocation disabled when Chrome is in the background or ...
Issue 506435: Geolocation disabled when Chrome is in the background or screen turns off. ... Example URL: Steps to reproduce the problem: Go...
Read more >
Geolocation fails in Android 11 (API 30) - Capacitor
I'm having a hard time debugging this issue. I'm using Capacitor's geolocation functionality (and have been for a while).
Read more >
Behavior changes: apps targeting API 29+ - Android Developers
These changes, which affect apps that target API level 29 or higher, ... on non-SDK interfaces, you should begin planning a migration to...
Read more >
cordova-plugin-socrates3-background-geolocation - npm
cordova-plugin-mauron85-background-geolocation · Description · Example Application · Submitting issues · Semantic Versioning · Migration to 2.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found