Open theobouwman opened 1 year ago
Hi @theobouwman ,to achieve what you're asking, you would need to listen for AppStateChange and then do what you require, when the AppState is in the background. Refer to this: https://reactnative.dev/docs/appstate
facing same issue
@aqil07 how would you use this? do we call watchPosition twice then? Once in foreground once in background? (on a sidenote, my research has pointed me in the direction of "foreground via persistent notification" which is the correct solution. From a user POV apps should be informing users that they are running still, I just didn't know that the app itself has to spawn that notification)
Hi @elibroftw , correct. When the "AppState" changes, then we call watchPosition.
Can I use this when I force close the app? Or have not even opened the app at all?
I want to track user location and maken api calls in the background.