Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location manager stops working after some interval in background

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.

like image 638
Himanshu Avatar asked Mar 26 '13 04:03

Himanshu


People also ask

What does using your location in the background mean?

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.

What is background location?

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.

How do I change the background location in Swift?

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”.


1 Answers

You have to specify that your app need location updates when in background in plist

enter image description here

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

like image 65
Inder Kumar Rathore Avatar answered Nov 10 '22 04:11

Inder Kumar Rathore