cllocationmanager

When does an iphone application receive didChangeAuthorizationStatus: delegate call?

有些话、适合烂在心里 提交于 2019-12-04 04:13:16
I have a question about CLLocationManagerDelegate . The documentation says if the user changes the settings for your location services (in the iPhone's Settings.app) then your app is supposed to receive an didChangeAuthorizationStatus: message to the delegate. My question is, when would this happen? If the user changed the setting, it means they are in the settings app, and your app is either backgrounded or not running at all, so in the former case, when would your app's CLLocationManager delegate get the didChangeAuthorizationStatus: call? I just ran across this method an hour ago, so good

CLLocationManager requestWhenInUseAuthorization() not working

感情迁移 提交于 2019-12-04 03:41:47
问题 I am trying to use location services in my iOS app but for some reason requestWhenInUseAuthorization is not working. When the user first uses the app, the prompt comes up as normal asking for permissions but then when you open the app a second time, for some reason didChangeAuthorizationStatus method is not called so I cannot display the user current location on the map. My code is below: override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view,

iOS Geofence, how to handle when inside region when monitoring starts?

…衆ロ難τιáo~ 提交于 2019-12-04 03:17:55
I have been unable to work out how to handle a scenario where the phone is already inside a region when startMonitoringForRegion is called? Other questions have suggested calling requestStateForRegion inside didStartMonitoringForRegion this then calls the method didDetermineState: forRegion: . So the code looks something like this: - (void)viewDidLoad { //location manager set up etc... for (Object *object in allObjects){ CLRegion *region = [self geofenceRegion:object]; [locationManager startMonitoringForRegion:region]; } } - (void)locationManager:(CLLocationManager *)manager

Check user location age in Mapkit - GPS accuracy for MapKit User Location significantly better than from CLLocationManager?

社会主义新天地 提交于 2019-12-04 02:06:02
问题 Indoors on an iPhone 4. WiFi disabled Running the LocateMe SDK sample or my own code for 30-60 seconds produces horizontal accuracy of 2294 meters. Pretty inaccurate but reasonable for cell tower triangulation. Looking at other apps that do reverse geocoding or location stuff like Foursquare shows a similar lack of accuracy. However, if I switch over to another view in my app that uses Mapkit and check/display the user location it is spot on. I mean to the house level accurate on the map

Can I test Significant-Change with Xcode simulator?

只愿长相守 提交于 2019-12-04 01:28:50
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 if this only because it don't work on simulator or because I did something wrong. Thanks I've answered this question before on SO, and using the simulator is not an accurate way to test for -startMonitoringSignificantLocationChanges. This method relies primarily on cell-tower triangulation and hand offs. You can occasionally get an initial fix from

Apple rejection because UIBackgroundMode = location

北慕城南 提交于 2019-12-04 00:43:10
I submitted an app which tracks the user's location (and sends it to the server) at some fixed intervals chosen by the user (5 min, 10 min, 30 min, 1 h). The app should work in background, too (sending the requests) and I have declared it as UIBackgroundMode = location . I am able to send the requests while in background at those fixed intervals. Apple rejected it, suggesting the following: We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines. We

How do you use CLRegion in iOS 7 since initCircularRegionWithCenter:radius:identifier: is deprecated?

…衆ロ難τιáo~ 提交于 2019-12-04 00:20:22
Since the depreciation of initCircularRegionWithCenter:radius:identifier: , how would you define the region to be monitored using CLLocationManager ? Since CLCircularRegion is a subclass of CLRegion , you can just cast the instance. CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:theCenter radius:theRadius identifier:theIdentifier]; // Then cast the instance for use with your CLLocationManager instance [manager startMonitoringForRegion:(CLRegion *)region]; 来源: https://stackoverflow.com/questions/19205210/how-do-you-use-clregion-in-ios-7-since

How do startMonitoringSignificantLocationChanges and startUpdatingLocation effect one-another?

a 夏天 提交于 2019-12-03 23:07:40
What happens if I call startUpdatingLocation while startMonitoringSignificantLocationChanges is running? Does significantLocationChange monitoring get stopped? If I then stopUpdatingLocation will significantLocationChange monitoring continue or restart? I can find no documentation covering the interplay between these two ways of monitoring location. They are not meant to be used concurrently. It's either or as they both deliver heading and location changes to the same delegate method. locationManager:didUpdateToLocation:fromLocation They differ in the frequency and accuracy (and by extension

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

a 夏天 提交于 2019-12-03 22:25:18
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 = CLLocationManager.authorizationStatus() if(status == CLAuthorizationStatus.NotDetermined) { self.locationManager.requestAlwaysAuthorization(); } else { self.startMonitoring() } ... } the callback never gets anything but NotDermined and there is no UIAlertView shown to the user. func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus status:

StartUpdatingLocation Vs significant-change location service

做~自己de王妃 提交于 2019-12-03 21:34:44
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? startUpdatingLocation updates the location when it is called first time and then when the distance filter value exceeds. But the