cllocationmanager

Tracking multiple (20+) locations with iOS geofencing

主宰稳场 提交于 2019-11-27 10:48:40
An iOS application uses the geofencing for notifying the user about predefined nearby locations. The application is allowed to miss some location (the user is not getting a notification about a nearby location), but it is desirable to keep the missing rate low. One way to implement this would be to start monitoring for significant change locations with startMonitoringSignificantLocationChanges and each time the "location change" event is fired, look for locations within, let say, 500m radius of the reported location. What worries me is the requirement to perform the query for the nearby

Xcode / iOS simulator: Trigger significant location change manually

廉价感情. 提交于 2019-11-27 10:33:08
Is there a way to manually tell the device to dispatch a significant location change notification that will wake up any applications registered for this notification? This is for testing only, and I realize this private API call would get rejected upon submission to the app store. So two answers: A) Hop on a train :-) B) Use the simulator. In iOS 5.x simulator, there is a debug menu that has a location submenu. Choose freeway drive. This will start the simulator on an imaginary journey down the scenic 280 in Northern California. It gives you everything but the view: your app will get

Xcode 6 GM - CLLocationManager

大憨熊 提交于 2019-11-27 09:21:33
I have a project made using Xcode 5. I have a ViewController where i take the phone location using a CLLocationManager. I have implemented both: -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations -(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error which worked great. Now i opened the project with Xcode 6 GM, and neither of these 2 methods where called (not on simulator, or device). Any ideas? Thanks Bhumit Mehta Please check the thread here You have to take care of two things 1. requestAlwaysAuthorization - for

iPhone CLLocationManager updates every 0.5 seconds

僤鯓⒐⒋嵵緔 提交于 2019-11-27 08:12:29
问题 For an app that does lots of calculation from the GPS, I need to get the latitude/longitude and speed every 0.5 second to be very accurate and avoid delay. I am using: [locationManager setDesiredAccuracy:kCLLocationAccuracyBestForNavigation]; - locationManager:didUpdateToLocation:fromLocation: function to store the value in 3 variables: newLatitude , newLongitude and newSpeed An NSTimer object that call a function every 0.5 second. See below a graph generated by Excel representing the

ios getting my location regularly and setting button to get my location - Google Map not working

时光总嘲笑我的痴心妄想 提交于 2019-11-27 07:36:51
问题 I am working on Google Map Module , using 1.9.0 Bundle, to find my location on regular basis , say 10 seconds and create a button to get my location button as one of mapview settings When it comes to the execution and location service is turned on, there are no responses after clicking the right bottom button or not, the location manager is not working. I can show any signs of using location service. I am not sure what I am missing on setting this map as i follows strictly on the SDKDemos -

StartUpdateLocations in Background, didUpdatingToLocation only called 10-20 times

冷暖自知 提交于 2019-11-27 07:09:00
Testing Device: iPhone 5 (iOS 7) I have an app that uses RegionMonitoring and updateLocation . If a region is entered, didEnterRegion is called as expected. Then I call startUpdatingLocation . But the method didUpdateToLocation is only called 10-20 times while it should update the location until the timer fires. The relevant code: CLLocationManager *_locationManager; NSTimer *_timer; -(void)initLocationManager { _locationManager = [[CLLocationManager alloc] init]; _locationManager.delegate = self; [_locationManager setActivityType:CLActivityTypeOther]; [_locationManager setDesiredAccuracy

Replacement for “purpose” property of CLLocationManager

房东的猫 提交于 2019-11-27 04:27:55
In iOS 6, the purpose property of CLLocationManager, to describe the reason for using location services ( @property(copy, nonatomic) NSString *purpose ) has been deprecated. What replacement, if any, is proposed by Apple? The replacement for the purpose property in iOS 6 is a new Info.plist key named NSLocationUsageDescription (aka "Privacy - Location Usage Description"). The key is documented in the Information Property List Key Reference but unfortunately it's not mentioned with the deprecation note of the purpose property. However, the CLLocationManager.h does have this comment: *

IOS 9 Error Domain=kCLErrorDomain Code=0 “(null)”

你。 提交于 2019-11-27 04:22:00
Code below should get current location. But above error is generated. Function didUpdateLocations never gets called. Running this on a device (iPhone 5s)iOS 9.1. Info.plist has Required device capabilities and Privacy - Location usage description configured as shown in the attached image. Please help! let locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() locationManager.delegate = self locationManager.requestAlwaysAuthorization() locationManager.requestLocation() } func locationManager(manager: CLLocationManager, didFailWithError error: NSError) print

iOS7 Core Location not updating

安稳与你 提交于 2019-11-27 03:56:01
问题 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 stops... //Setup Location Manager in ViewDidLoad locationManager = [[CLLocationManager alloc] init]; [locationManager setDistanceFilter:kCLDistanceFilterNone]; [locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; [locationManager

why self.locationManager stopUpdatingLocation doesn't stop location update

半腔热情 提交于 2019-11-27 03:46:27
问题 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 getter is overridden to check for availability of the serive, to see whether its authorized. If so, it allocs/inits and startMonitoringSignificantLocationChanges and returns . In viewDidDisappear , I call [self.locationManager stopUpdatingLocation]