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
13
votes
6 answers

locationServicesEnabled always return YES

I tested my device (iPod Touch 2G iOS 4.1) if location services are enabled permitted = [locationManager locationServicesEnabled]; and I always get a YES whether location services are enabled or not. I'm talking about the general button for…
testing
  • 19,681
  • 50
  • 236
  • 417
13
votes
4 answers

Swift requestWhenInUseAuthorization not working

I'm writing an app for iOS 9.3 using swift and need a map to show user location. I initialize CLLocationManager and its delegate, I configure info.plist Privacy - Location Usage Description string and invoke requestWhenInUseAuthorization but it…
Andrea Giusti
  • 405
  • 1
  • 5
  • 12
13
votes
1 answer

Keychain sometimes returns empty value

We are using native key-chain wrapper class to store and retrieve values from the key-chain. But in some case the value is getting deleted/empty. We have the below items enabled in our app Location service ON - Always state initially and user can…
13
votes
9 answers

locationManager didUpdateLocations fires twice on device, only once on simulator

Same code, I'm assuming that the device is actually updating the location twice for some reason, even though I only call startUpdatingLocation() once and I run some stopUpdatingLocations() inside of didUpdateLocations func locationManager(manager:…
sdouble
  • 1,055
  • 3
  • 11
  • 28
13
votes
1 answer

Google maps : Error when typing in coordinates of certain countries

I'm drawing routes on google map and just realized it all works fine except I send coordinates of somewhere in Korea.(South to be precise) JSON data is null even though the coordinates are correct and keeps "zero results"'ing me. I've tried Africa,…
durazno
  • 559
  • 2
  • 7
  • 25
13
votes
2 answers

Region monitoring current location doesn't notify on exit

I'm trying to test region monitoring, for that I'm getting current location like this: - (void)startLocationTracking { CLLocationManager *locationManager = [[CLLocationManager alloc] init]; // Start location manager if…
Idan Moshe
  • 1,675
  • 4
  • 28
  • 65
12
votes
6 answers

What is the maximum number of regions that can be monitored with startMonitoringForRegion:region desiredAccuracy:accuracy?

The documentation says there's a limit to the number of regions that can be monitored with- (void)startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy but I couldn't find what that limit is, does anybody know?
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
12
votes
2 answers

Can I test Significant-Change with Xcode simulator?

I wonder if I could test Significant-Change location service (startMonitoringSignificantLocationChanges method ) in Xcode Simulator or it just only works in actual device. Notice, I already tried it in Simulator and it didn't work, but I'm not sure…
user836026
  • 10,608
  • 15
  • 73
  • 129
12
votes
2 answers

Location Manager update frequency, iphone

I have a CLLocation manager called "myLocation". myLocation = [[CLLocationManager alloc] init]; myLocation.desiredAccuracy = kCLLocationAccuracyBestForNavigation ; myLocation.distanceFilter = 10 ; myLocation.delegate=self; …
alekhine
  • 1,600
  • 4
  • 20
  • 45
12
votes
1 answer

CLLocationManager Singleton - is this the way to go?

I'm building an app with two simple views (in a tabbar). first view: it should show the user's location (default blue dot) and load data from a server. second view: it should show the user's location (my custom pin with annotation and callout). the…
koichirose
  • 1,815
  • 4
  • 22
  • 30
12
votes
2 answers

Continuous location update background iOS13

I am currently testing the background location mode in iOS 13, as I want to track the user´s location and motion (using the CMMotionManager) in the background. Therefore, I have my own (singleton) class handling the location tracking. I initialize…
mattll
  • 121
  • 1
  • 6
12
votes
1 answer

didChangeAuthorizationStatus not called after clicking Allow

This is my code for implementing google map and CLLocationManager: class MapViewController: UIViewController { @IBOutlet weak var MapView: GMSMapView! var locationmanager = CLLocationManager() override func viewDidLoad() { …
Amir_P
  • 8,322
  • 5
  • 43
  • 92
12
votes
6 answers

Delegate must respond to locationManager:didUpdateLocations swift eroor

Hy guys, I'm making an app in swift 3.0 but I ran across a problem pretty soon. I set up necessary functions to ask for permission to use a location but every time I run the app I get the same error... Viewcontroller.h import UIKit import…
Sam VG
  • 143
  • 1
  • 2
  • 9
12
votes
2 answers

didEnterRegion firing for all my geofences

All my geofences are triggering when GPS enters a defined region, at first I thought it was because of the radius, however even after halving it I am having the same problem. import UIKit import CoreLocation class itemDesc { var title: String …
Magrafear
  • 573
  • 4
  • 17
12
votes
3 answers

how do I detect location service disable for my app?

IOS4 has recently introduced the possibility to enable/disable location services for a specific application. I need to detect if this settings is enabled/disabled for MY application. First I have tried with: if ([CLLocationManager…
Massimo
  • 231
  • 1
  • 3
  • 7