cllocationmanager

StartUpdatingLocation Vs significant-change location service

自闭症网瘾萝莉.ら 提交于 2019-12-21 05:37:06
问题 I am having issue regarding significant-change location service. Apple documentation says "Whether you use the standard location service or the significant-change location service to get location events, the way you receive those events is the same." but in case of "significant-change location service" I am not able to get any callbacks which I get in case of "standard location service" Please let me know if anybody has any inputs? 回答1: startUpdatingLocation updates the location when it is

locationManager:didFailWithError: not called if user Location Services are off

南笙酒味 提交于 2019-12-21 05:32:17
问题 From the documentation for locationManager:didFailWithError: If the user denies your application’s use of the location service, this method reports a kCLErrorDenied error. Upon receiving such an error, you should stop the location service. It works when the user press "Don't Allow" to the question "MyApp Would Like to Use Your Current Location", so you can manage this eventuality. But nothing happen when the user press "Cancel" to the question "Turn On Location Services to Allow "MyApp" to

Check if system time is auto or user set

纵然是瞬间 提交于 2019-12-21 05:22:25
问题 I need to set up user proof time keeping in my current project. I have found a lot of different question around this, but none that seem to have the answer I am looking for. These are the questions i have looked at so far: XCODE: How to get/verify ACCURATE timestamp from device Is it possible to get the atomic clock timestamp from the iphone GPS? How can I get the real time in iPhone, not the time set by user in Settings? I have several options for getting a time from a server connection but

Objective C - CLLocationManager find out when “Allow” or “Don't allow” is clicked

假装没事ソ 提交于 2019-12-21 05:22:18
问题 When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location? I tried this but this doesn't get called after a user "Allow" or "Don't allow". - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status; Also, is there a variable that will tell me what the user selected? I tried the below, but that always returns true. locationManager

CLLocationManager not working all the time (iOS 8, Xcode 6)

我的未来我决定 提交于 2019-12-21 04:18:33
问题 Basically half the time the delegate method - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations; is not called at all. But the other half of the time it works perfectly! I've found that it usually happens when I first start up Xcode after closing and quitting it, but then after that or a couple runs after that it seems to work fine. I'm not 100% sure if it's just an Xcode problem or what, I'll be getting a developer's license soon so I'll see if it

difference between desiredAccuracy and distanceFilter

偶尔善良 提交于 2019-12-21 04:16:07
问题 Sorry for being a noob here. I am not able to clearly differentiate between CLLocationManager's properties distanceFilter and desiredAccuracy . If I want my application to give different coordinates for even small distances (say 100-200 metres) what values should i set for these properties. Help would be greatly appreciated. 回答1: According to developer.apple.com distanceFilter The minimum distance (measured in meters) a device must move laterally before an update event is generated. That

Why requestWhenInUseAuthorization doesn't prompt the user for access to the location?

别等时光非礼了梦想. 提交于 2019-12-20 07:59:11
问题 In my viewDidLoad method I have locationManager = [[CLLocationManager alloc]init]; // initializing locationManager locationManager.delegate = self; // we set the delegate of locationManager to self. locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [locationManager requestWhenInUseAuthorization]; } And the request is called, but the user is not prompted? Why? 回答1: You probably

MapKit giving wrong lat & lang - iOS 8

柔情痞子 提交于 2019-12-20 05:57:36
问题 When I try to use map in iOS 8, I get below error. Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first. For this I tried solution from here, but still no luck. Below is what I did. Step 1. Have entry in Info.plist NSLocationWhenInUseUsageDescription - This is test text Step 2. Updated -(CLLocationCoordinate2D) getLocation -

How to monitor more than 20 regions using CLLocationManager

独自空忆成欢 提交于 2019-12-20 05:34:20
问题 I have about 2000 regions I want to monitor (entrance only) using CLLocationManager , I have a function that finds the 20 nearest stores ( Store is a class that inherits from NSObject and has a CLLocationCoordinate2D property named geoPoint ) to the user's current location but where should I call it? If someone will be able to help me with a code example it'll be great! Finding the 20 nearest stores func: -(void)sortClosestStores { [self.allStores sortUsingComparator:^NSComparisonResult(id

Implementing Periodic Location Updates in iOS even if app gets terminated

一曲冷凌霜 提交于 2019-12-19 10:53:46
问题 My application requires periodic location updates (every 10 minutes). In foreground and background (app not terminated) the application is working correctly. But the problem starts to occur when the app is terminated by the user. I tried using this tutorial http://mobileoop.com/getting-location-updates-for-ios-7-and-8-when-the-app-is-killedterminatedsuspended . It works only when user's location is changing because of startMonitoringSignificantLocationChanges . But I need locations in