cllocationmanager

How to stop updating location once I get current location?

蹲街弑〆低调 提交于 2020-08-08 20:30:58
问题 I'm using Parse and with geoPointForCurrentLocationInBackground I can stop updating once a location is received without having to manually stop it. How do I stop updating location immediately right after I receive location using CLLocationManager? Edit I know [self.locationManager stopUpdatingLocation]; stops it. What I'm really asking is, how do I know I've received location for the first time then stop it immediately? 回答1: After getting your location, use this method: [self.locationManager

kCLErrorDomain Code=8 "The operation couldn’t be completed.

一笑奈何 提交于 2020-05-27 12:49:05
问题 Am starting to do reverse geocoding, and the _geocoder instance variable gets initialized OK, but no data gets passed to the _placemark object. Here is the error log: 2013-12-16 14:00:12.040 MyLocations[10555:70b] *** Going to geocode 2013-12-16 14:00:12.041 MyLocations[10555:70b] *** Found placemarks: (null), error: Error Domain=kCLErrorDomain Code=8 "The operation couldn’t be completed. (kCLErrorDomain error 8.)" Am assuming that the locationManager:didFailWithError: method is getting

How to get local notification when user enters into specific region provided ios

不羁的心 提交于 2020-03-03 10:12:47
问题 I am working on such a project where apps do the following things: 1.Getting user current location. 2. Get local notifications when user enters or nearby the particular locations i provided. What i have done is: I have downloaded the regions sample code(apple provided) to find out my current location using IOS corelocation framework.It works fine.here's the code below: // Create a new region based on the center of the map view. CLLocationCoordinate2D coord = CLLocationCoordinate2DMake

CLLocationManager Delegate methods are not getting called

不羁的心 提交于 2020-01-30 05:06:01
问题 I am using CLLocationManager class. I have a simple class method for capturing the location +(void)captureLocation{ mLocationManager = [[CLLocationManager alloc]init]; mLocationManager.delegate = (id<CLLocationManagerDelegate>)self; mLocationManager.desiredAccuracy = kCLLocationAccuracyBest; [mLocationManager startUpdatingLocation]; } and i have the delegate methods of CLLocationManager also - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { } - (void

allowsBackgroundLocationUpdates in CLLocationManager in iOS9

对着背影说爱祢 提交于 2020-01-26 08:46:07
问题 I'm using CoreLocation framework in my app in Xcode7(pre-released),and I noticed that there is a newly added property called allowsBackgroundLocationUpdates in CLLocationManager class. What's the relationship between this property and the location updates in the Background Modes of the Capabilities tab. What's the default value of it and does it affect apps running in iOS9? 回答1: This new property is explained in the WWDC session "What's New in Core Location". The default value is NO if you

iOS 13 check for provisional authorization status of CLLocationManager

ぐ巨炮叔叔 提交于 2020-01-24 11:34:42
问题 As per the WWDC video, https://developer.apple.com/videos/play/wwdc2019/705/, when you ask for " AlwaysAuthorization " permission you will see only " When In Use, Once and Don't allow" . Even if you tap on " When In Use ", the delegate call back will come back as kCLAuthorizationStatusAuthorizedAlways . This is working as expected. But is there a way to find out that the request is still provisional or actually-always-allow? There is no enum associated to this permission. The only allowed

iOS 13 check for provisional authorization status of CLLocationManager

眉间皱痕 提交于 2020-01-24 11:34:07
问题 As per the WWDC video, https://developer.apple.com/videos/play/wwdc2019/705/, when you ask for " AlwaysAuthorization " permission you will see only " When In Use, Once and Don't allow" . Even if you tap on " When In Use ", the delegate call back will come back as kCLAuthorizationStatusAuthorizedAlways . This is working as expected. But is there a way to find out that the request is still provisional or actually-always-allow? There is no enum associated to this permission. The only allowed

iOS 13 check for provisional authorization status of CLLocationManager

强颜欢笑 提交于 2020-01-24 11:33:03
问题 As per the WWDC video, https://developer.apple.com/videos/play/wwdc2019/705/, when you ask for " AlwaysAuthorization " permission you will see only " When In Use, Once and Don't allow" . Even if you tap on " When In Use ", the delegate call back will come back as kCLAuthorizationStatusAuthorizedAlways . This is working as expected. But is there a way to find out that the request is still provisional or actually-always-allow? There is no enum associated to this permission. The only allowed

CLLocationManager didUpdateToLocation not being called after some time

一世执手 提交于 2020-01-24 06:07:09
问题 I am trying to record a users location over time. If the user is on the move it works fine and the delegate method didUpdateToLocation is invoked reliably.However if the user is stationary and the app is running in the background then after some time, the delegate method is no longer invoked. To restart it, the app needs to be bought into the foreground. Once it is active the delegate method is invoked reliably again. I initially thought that this could be due to the fact that the

Location manager didUpdateLocations not being called

こ雲淡風輕ζ 提交于 2020-01-22 00:41:46
问题 For some reason didUpdateLocations is not being called, even when I set the delegate to the view controller. In info.plist I set the key Privacy - Location When In Use Usage Description to a description. So I'm not sure what I could be doing wrong? import MapKit import CoreLocation class OptionsViewController: UIViewController, UITableViewDelegate, CLLocationManagerDelegate { override func viewDidLoad() { //Ask user for location locationManager = CLLocationManager() locationManager