-
Notifications
You must be signed in to change notification settings - Fork 232
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
Android: track user geolocation in background mode #285
Comments
Hey can you tell me how did you got it done in ios(code snippets), what are the caveats and did you do something extra for it ?thanks |
Hey, you can use |
HI, can you please tell me if this example works in both android and ios? |
@shuo-hiwintech i tried, not working, gets timeout if you try get a new location on background |
Are there any other solutions/packages to get background position? Using getPosition with background timer lead to a lot of timeout errors |
I've just created a fork that includes support for background location updates: |
I made some tests but unfortunately it has the same issues i found with react-native-geolocation-service + rn-foreground-service... on Android 14 after 10-15 seconds background position updates stop with no reason (foreground service seems alive). Thank you @quan118 |
I found a solution, that finally works for me. It's required to install 'react-native-background-actions' First of all, you need to add these permissions to AndroidManifest.xml
After that, you should ask the user to allow tracking of his location. Important that you should ask it one by one.
And need to configure the background task.
In the code above you can uncomment |
Hey team,
Did someone found a way, how to track user geolocation in background mode?
I implemented it on IOS and it's work perfectly without any extra libraries.
But on Android it's doesn't work.
Can someone help me or give a advice?
Thank you!
The text was updated successfully, but these errors were encountered: