Questions tagged [cllocationmanager]

The CLLocationManager class defines the interface for configuring the delivery of location- and heading-related events to your application

The CLLocationManager class defines the interface for configuring the delivery of location- and heading-related events to your application. You use an instance of this class to establish the parameters that determine when location and heading events should be delivered and to start and stop the actual delivery of those events. You can also use a location manager object to retrieve the most recent location and heading data.

A location manager object provides support for the following location-related activities:

  • Tracking large or small changes in the user’s current location with a configurable degree of accuracy.
  • Reporting heading changes from the onboard compass. (iOS only)
  • Monitoring distinct regions of interest and generating location events when the user enters or leaves those regions.
  • Deferring the delivery of location updates while the app is in the background. (iOS 6 and later only)
2729 questions
12
votes
3 answers

Find closest longitude and latitude in array from user location - iOS Swift

In the question posted here, the user asked: I have an array full of longitudes and latitudes. I have two double variables with my users location. I'd like to test the distance between my user's locations against my array to see which location is…
tsteve
  • 549
  • 1
  • 7
  • 16
12
votes
1 answer

Standard Location Service battery drain on iOS

I noticed that if I have an application using Significant Location Change it does take approximately 30% of my battery over 24H. I thought that SLC was not supposed to drain the battery. Is this behaviour normal? We made our tests scientifically on…
poiuytrez
  • 21,330
  • 35
  • 113
  • 172
12
votes
0 answers

How can I test if visit monitoring is working in my iOS app? (Using startMonitoringVisits api)

I'm developing a location journaling app for iPhone, and I'm trying to use the new visit monitoring API for iOS 8. I've read the Xcode documentation and watched a WWDC 2014 Video, and I think I've properly implemented the startMonitoringVisits and…
ConfusedByCode
  • 1,137
  • 8
  • 27
12
votes
2 answers

How to use MKMapView's "Shows User Location" in iOS8?

When you add an MKMapView component to the view in Interface Builder, there are checkboxes that let you configure what it shows: When you check "User Location", it automatically shows user's location on the map. However, since iOS 8 you're supposed…
Kuba Suder
  • 7,587
  • 9
  • 36
  • 39
12
votes
1 answer

locationManager didFailWithError

from 1 week if my gps app fail to retrieve signal (eg: testing in my home) i don't receive any aler. i've setup my error notification in this way - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { NSString…
12
votes
1 answer

iOS7 Core Location not updating

I have a very simple app example that initialises and updates the users location.. On device it successfully throws another callback location every second or so however on device (iPhone running iOS7) is calls the method once and then mysteriously…
12
votes
2 answers

iOS - Determine User's country without using CLLocationManager

I don't need precise location data, and I don't want the user to see the "This App wants to determine your location" Alert. I just need to determine the user's country, assuming they have an internet connection via network or wi-fi. What is the best…
soleil
  • 12,133
  • 33
  • 112
  • 183
12
votes
1 answer

On which iOS devices exactly is region monitoring supported?

From what I can interpret from the runtime requirements of sample region monitoring code of Apple, region monitoring is available on iPhone 4, iPad 2 Wifi + 3G or later. So I'm assuming that it's not available on iPad1 with 3G, or iPhone 3G/3GS. Is…
aslı
  • 8,740
  • 10
  • 59
  • 80
11
votes
1 answer

NSLocationAlwaysUsageDescription string added in info.plist is not showing in permission popup ios

NSLocationAlwaysUsageDescription Location is required to find out where you are Privacy-Location Usage Description Location is required to find out where you…
Shilpa M
  • 151
  • 1
  • 1
  • 7
11
votes
7 answers

UIAlertView like "Turn On Location Services to allow maps to determine your location". Settings + Cancel

I Want to emit this alert: Turn On Location Services to allow maps to determine your location I need both "Settings" and "Cancel" exactly like the "maps" application. "Settings" should open settings->general->location services I didn't find the way…
Massimo
  • 231
  • 1
  • 3
  • 7
11
votes
8 answers

didUpdateLocations never called

I'm trying to get the user's location. To do so I have set the following property in the info.plist : I have also added the following code in my viewDidLoad method as well as the function below. The problem is that the locationManager(manager,…
Alk
  • 5,215
  • 8
  • 47
  • 116
11
votes
4 answers

Finding Direction in iPhone like in Compass?

Do any one have idea for finding true direction using iPhone? I want to implement such application in which I need to find direction in which iPhone is pointing and want to make application same as compass application in iphone 3GS. Does iPhone 3G…
11
votes
1 answer

didUpdateLocations not being called when app is in background

didUpdateLocations is working fine when app is active and running in foreground, but it stops to work as soon as app enters into background In .h file @property (nonatomic, strong) CLLocationManager *customerLocationManager; in .m file @synthesize…
Kunal Babbar
  • 113
  • 1
  • 5
11
votes
4 answers

How to get the exact authorization status of location service?

If user has explicitly denied authorization for this application, or location services are disabled in Settings, it will return Denied status. How can I know the exact reason of it?
debuggenius
  • 449
  • 5
  • 15
11
votes
4 answers

Access the user's location on Today Extension

Is it possible to access the user's location on a widget? I used the new iOS 8 API [locationManager requestWhenInUseAuthorization]; and I added to the info.plist file the key NSLocationWhenInUseDescription however, when I request the…