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
30
votes
9 answers

iOS Geofence CLCircularRegion monitoring. locationManager:didExitRegion does not seem to work as expected

I am currently trying to get my app to monitor particular regions using CoreLocation however I am finding that it does not seem to work as expected, it seems to me that it cannot work with small a small radius set for each location i.e. 10m. I've…
MonkeyBlue
  • 2,234
  • 6
  • 31
  • 41
29
votes
3 answers

How to set accuracy and distance filter when using MKMapView

When i use setShowsUserLocation with MKMapView to track user location, how do I set the accuracy and distance filter? I am not talking about CLLocationManager. Thanks,
Van Du Tran
  • 6,736
  • 11
  • 45
  • 55
29
votes
3 answers

iPhone GPS in background never resumes after pause

My application needs to track user location changes in the background and works fine as long as user moves around. When user stops and CLLocationManager pauses after 10-20 minutes or so. It is indicated by this…
Lukasz
  • 19,816
  • 17
  • 83
  • 139
27
votes
2 answers

CLLocationManager and accuracy issues - any experiences?

So I am dealing with some accuracy issues with iPhone GPS. I have an app which uses location. In the delegate method locationManager: didUpdateToLocation: fromLocation: I am being returned a location. From a bit of research, it appears the GPS isn't…
runmad
  • 14,846
  • 9
  • 99
  • 140
27
votes
5 answers

Implement CLLocationManagerDelegate methods in Swift

I've been trying to get this to work for awhile now, and I've come here to ask- how do I go about with using the CLLocationManagerDelegate methods in Swift? I've put this at the top of my class: var locationManager = CLLocationManager() I've put…
user1327904
27
votes
6 answers

CLLocationCoordinate2D to CLLocation

I have the following loop in my viewDidLoad: for(int i=1; i<[eventsArray count]; i++) { NSArray *componentsArray = [[eventsArray objectAtIndex:i] componentsSeparatedByString:@","]; if([componentsArray count] >=6) { Koordinate *coord…
Marco
  • 461
  • 1
  • 10
  • 22
27
votes
3 answers

Start Location Manager in iOS 7 from background task

It seems that in iOS 7 an app can not start Location Manager (by calling startUpdatingLocation) from the background task anymore. In iOS 6 I used approach described here: https://stackoverflow.com/a/6465280 to run background location update every n…
sash
  • 8,423
  • 5
  • 63
  • 74
26
votes
9 answers

why self.locationManager stopUpdatingLocation doesn't stop location update

Problem: It seems I can't stop Core Location from sending updates to my app / tracking. What am I doing: In my viewWillAppear I call self.locationManager and pass it to a method to show user's location on the map (an instance of MKMapView). The…
Sierra Alpha
  • 3,707
  • 4
  • 23
  • 36
26
votes
6 answers

Background user location when app is terminated/suspended

I've been trying to figure out how to get the user's location when the app is terminated like how the app Moves does it. The only way I know of doing so is with Significant Location Changes. However with significant location changes, the app only…
Zack
  • 881
  • 1
  • 9
  • 13
26
votes
1 answer

Reverse Geocode Location in Swift

My input is a latitude and longitude. I need to use the reverseGeocodeLocation function of swift, to give me the output of the locality. The code I have tried to use is println(geopoint.longitude) …
TimWhiting
  • 2,405
  • 5
  • 21
  • 41
25
votes
3 answers

CLLocationManager.authorizationStatus() always CLAuthorizationStatus.NotDetermined with swift&objC app

I just can get my CLLocationManager to authorise. (swift under ios8) I even add an explicit requestAlwaysAuthorization call (which I don't need with objC under ios7) func finishLaunch() { //ask for authorization let status =…
Daij-Djan
  • 49,552
  • 17
  • 113
  • 135
25
votes
4 answers

How to get current zoom level from google map for ios?

I use method camera with digital value like this: camera = [GMSCameraPosition cameraWithLatitude:37.35 longitude:-122.0 zoom:6]; and I need automatically redraw map with current position via timer: -(void)gmapRedraw{ NSLog(@"gmapRedraw"); // …
strx86
  • 661
  • 1
  • 6
  • 8
24
votes
2 answers

iOS 12 terminates apps in the background for no reason

Starting from iOS 12 the CLLocationManager doesn't run endless anymore in the background. The app get's terminated without a crashlog at random times. This was working fine before iOS 12. To demonstrate this problem I've created an sample app…
Sjoerd Perfors
  • 2,317
  • 22
  • 37
24
votes
1 answer

CLLocationManager geo-fencing/startMonitoringForRegion: vs. startMonitoringForSignificantLocationChanges: vs. 10-minute startUpdating calls

I am trying to set up an app that will be able to check people's locations in the background, see if they are at a given location, and send a ping to a server if they are. We do not want to drain the energy of our users, so we are attempting to…
AdamG
  • 3,718
  • 2
  • 18
  • 28
22
votes
5 answers

Why is my CLLocationmanager delegate not getting called?

I'm not getting any location callbacks on either sim or device. I've got this code being called: - (void)startLocationCallbacks: (NSObject*) ignore { locationManager.delegate = self; locationManager.desiredAccuracy =…
Olie
  • 24,597
  • 18
  • 99
  • 131