Closed Reenagrg100 closed 3 years ago
Are you aware that the iOS plugin requires that the device move at least 200 meters after being terminated before your app will re-launch and tracking resume?
Set debug: true
, boot your app in the iOS SImulator, simulate location with Freeway Drive then terminate your app.
Yeah, @christocracy I'm aware of this thing and I have mentioned this also above that even after moving 3-4kms( for 1hr through the car), I'm not able to get any location. Although I'm able to get it on the simulator but not on any device. I have also made sure that permission is set to "Always allow".
I suggest you install the SampleApp on your device and test it. Do not look at the code. Just clone the repo and install it on your device.
Okay, I'll install it. @christocracy. Any idea if it's device model-specific or ios specific? like ios version above 14.0.
Any idea if it's device model-specific or ios specific? like ios version above 14.0.
It's not related to device or OS. It is either your code or the environment.
Okay, thank you so much for the quick reply @christocracy. As soon as there will be any update I'll update here.
Are you aware that the iOS plugin requires that the device move at least 200 meters after being terminated before your app will re-launch and tracking resume?
Hey, @christocracy I'm a little confused with your response.
Are you saying that after terminating the app and moving at least 200 ms when we will re-launch the app again then we will get that one location data point and start getting the next data points further or we will be getting all the location data points during that killed state until we don't re-launch the app? Please clarify your response.
So, in short, will we get all the location data points during the killed state of the app on iOS ?
Are you saying that after terminating the app and moving at least 200 ms when we will re-launch the app again then we will get that one location data point and start getting the next data points
When the app is terminated, you will not receive any data until your app is relaunched and tracking resumes. There will be a "hole" in your data.
Read the API docs for Config.stopOnTerminate
So, in short, will we get all the location data points during the killed state of the app on iOS ?
No. There is no data while your app remains terminated. That data is not recorded. You will have no idea about the location between the point where the device is terminated and where your app relaunches after ~200 meters.
Read the API docs for Config.stopOnTerminate
Thanks, @christocracy! I got it right, also read the docs again just to be sure.
As per the docs, it's been said. Terminate the app -> move at least 200ms => Behind the scene our app will get the reboot in the background and tracking resumes. So, post that we will get all the data points in the app's terminated state. Right??
And after reading your above response, somewhere it's reflecting that we are not gonna get data during the whole terminated state of the app until we don't re-launch the app again. ( means the state of the app doesn't change from terminated to foreground).
Please Note:- I'm not expecting data for that at least 200ms distance. I'm only expecting only post that but in the terminated state itself.
I suggest you install the SampleApp on your device and test it. Do not look at the code. Just clone the repo and install it on your device.
Also, is this app available on the AppStore? I can see it on the PlayStore for android but not on AppStore for ios.
Also, is this app available on the AppStore?
No. See the Github repo for instructions on how to manually build the app onto your iOS device.
Read the API docs for Config.stopOnTerminate
Thanks, @christocracy! I got it right, also read the docs again just to be sure.
As per the docs, it's been said.
Terminate the app -> move at least 200ms => Behind the scene our app will get the reboot in the background and tracking resumes. So, post that we will get all the data points in the app's terminated state. Right??
And after reading your above response, somewhere it's reflecting that we are not gonna get data during the whole terminated state of the app until we don't re-launch the app again. ( means the state of the app doesn't change from terminated to foreground).
Please Note:- I'm not expecting data for that at least 200ms distance. I'm only expecting only post that but in the terminated state itself.
Please clarify this also @christocracy. Thanks in advance for your help.
- When an iOS app is terminated you get no data.
- When the device moves about 200 meters after being terminated, the OS will automatically relaunch your app in the background (just as if launched by the user from the home-screen) and tracking resumes. Your app is no longer terminated -- it is now running in the background.
So, here you mean the user doesn't need to manually re-launch it. OS itself will take care of re-booting the device behind the scene and also user won't be seeing it in the background apps on his/her device. So, for the user app is still terminated and for OS, it's in the background. Am I getting it right? @christocracy.
So, here you mean the user doesn't need to manually re-launch it
Correct. This is easily demonstrated in the iOS simulator.
Hey, @christocracy I know you have closed this issue but this is not closed for me.
I was reading this same issue reported by someone https://github.com/transistorsoft/react-native-background-geolocation/issues/1166 and you mentioned here that wifi must be enabled from the device settings. So, here do you mean by the "internet should be available on the device"? It could be Mobile internet also, right? or Is it particularly only "wifi".
Just curious to know if you mean by only "wifi", then generally we don't have any access to wifi while moving, we use our mobile internet in that case.
iOS needs Wifi enabled so it can use the geolocation of detected wifi routers to evaluate geofences. It doesn't mean the device needs to actually be authenticated with a router.
Both iOS and Android maintain a massive database of Wifi routers and their corresponding geolocation throughout the world.
Wifi needs to be ENABLED, not DISABLED.
Your Environment
Plugin version: react-native-background-geolocation": "3.9.3" & react-native-background-fetch": "3.0.6" Platform: iOS only OS version: 13.1.1,14.3 Device manufacturer / model: iPhone Xr and iPhone 12mini
React Native version (react-native -v): 0.62.2