I m developing an app in which I have to track the LocationUpdate
in the Background
as well as in the Foreground
but after some time interval in the Background
the app stops updating the Location
. When I take it back to Foreground
it starts again and when I put it in background after some time interval it stops again.
I am not able to find the issue please help me if possible.
In the foreground: The app can use your location only when the app is open on your screen or when you ask the app to do something. In the background: The app can use location info at any time, even if you aren't using it.
Android 10 features a background access location reminder, which increases transparency into how much access apps have to a device's location and helps users maintain control over such access. In Android 9 and lower, an app can track a device's location while running in the background without the user's knowledge.
Select your project using the project navigator, then find your app's target and choose the Capabilities tab. You need to enable Background Modes, then check the box marked “Location updates”.
You have to specify that your app need location updates when in background in plist
Here is apple docs Getting Location Events in the Background
and here is a tutorial for this.
And I would recommend you to read Location Awareness Programming Guide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With