transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.54k stars 424 forks source link

Background Geolocation Fails to Fetch Location in Background or Locked Screen #1961

Closed socheatleang closed 2 weeks ago

socheatleang commented 2 months ago

Location Permission Re-prompt on Resume from Background/Lock Screen Hinders Activity Data Retrieval. Has anyone else encountered this issue, or is it specific to my device?

Your Environment

Expected Behavior

With the WhenInUse's permission, The app should continuously fetch and record the user's location in the background, even when the screen is locked or when the app is not actively in use. There should not be any need for the user to re-allow permissions once they have been granted initially, ensuring a seamless tracking experience.

Actual Behavior

When the app goes into the background or when the phone's screen is locked, the location tracking sometimes prompts the user to allow location permissions again upon resuming. Additionally, the app fails to fetch or record the location data while running in the background or on a locked screen. This issue happens only sometimes. Not all the time

Steps to Reproduce

  1. Start location tracking with the app.
  2. Allow location with WhenInUse's permission
  3. Send the app to the background or lock the phone screen.
  4. After some time (20-30mn), resume the app.
  5. Notice the permission prompt reappears randomly and the location data isn't fetched while in the background or on a locked screen.

Context

I am sure that: