Migration to SDK29 seems to be causing background geolocation issues
See original GitHub issueYour 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
- Create a new React Native App
- Added this library
- Migrate to SDK29
- See the background geolocation fails
Context
Debug logs
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it would be nice if this library was added to https://github.com/react-native-community @react-native-community
Did you request this permission?
android.permission.ACCESS_BACKGROUND_LOCATION
https://developer.android.com/about/versions/10/privacy/changes