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

[docs] expo-location and expo-task-manager #28631

Open
srinivasbevara opened this issue May 6, 2024 · 1 comment
Open

[docs] expo-location and expo-task-manager #28631

srinivasbevara opened this issue May 6, 2024 · 1 comment
Labels

Comments

@srinivasbevara
Copy link

Summary

Hello,

I need to continuously track the user's live location in my app. I've implemented this functionality using expo-location and expo-task-manager, following a reference example. After deploying the app to the Google Play Store and conducting tests, we discovered that while the app is in the foreground, we successfully receive the user's live location. However, when the app is minimized or running in the background, we no longer receive live location updates. Could you provide any guidance or reference code to ensure that we can consistently obtain the user's live location even when the app is running in the background?

background-fetch:
We've implemented background-fetch to retrieve the user's live location every minute while the app is running in the background. However, our goal is to receive location updates at least every 10 seconds.

Reference code:

https://docs.expo.dev/versions/latest/sdk/task-manager/
https://docs.expo.dev/versions/latest/sdk/background-fetch/

https://arnav25.medium.com/background-location-tracking-in-react-native-d03bb7652602#:~:text=The%20task%20of%20location%20tracking,or%20stop%20tracking%20your%20location.

Link to the related docs page

https://docs.expo.dev/versions/latest/sdk/task-manager/

Anything else?

No response

@choutianxius
Copy link

I was facing the same issue. Found out that the JavaScript process might be suspended by the OS when the app is not in foreground, so probably nothing can be done on the Expo end. My solution was to cache the collected GPS data and send them when possible.

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