core-location

Region Monitoring Glitch on iOS 7 - Multiple Notifications at the same time

允我心安 提交于 2019-11-26 18:25:06
问题 I have been developing region monitoring on iOS for about 2 months. Recently we have found a glitch where all the regions within a certain radius (about 4.7KM or 4700 meters) triggered at the same time. The current location of the device is not even close to any of the regions. I am not sure what could have triggered that event. I have searched through StackOverFlow, Apple Developer forums and etc, I haven't find any similar issue with what I am facing. In the app that I am developing, we are

Behaviour for significant change location API when terminated/suspended?

冷暖自知 提交于 2019-11-26 18:03:46
This is the section from the CLLocationManager documentation describing the app behavior with startMonitoringSignificantLocationChanges : If you start this service and your application is subsequently terminated, the system automatically relaunches the application into the background if a new event arrives. In such a case, the options dictionary passed to the application:didFinishLaunchingWithOptions: method of your application delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your application was launched because of a location event. Upon relaunch, you must

Xcode / iOS simulator: Trigger significant location change manually

我的未来我决定 提交于 2019-11-26 17:57:47
问题 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. 回答1: 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

Testing CoreLocation on iPhone Simulator

醉酒当歌 提交于 2019-11-26 17:25:12
UPDATE: As of iOS 5 and Xcode 4.1 is is now possible to test location in the simulator and even define routes. See http://developer.apple.com for more details. Legacy Question Is there anyway to test CoreLocation on the iPhone Simulator? All I require is to be able to set the location myself and have CoreLocation return it. Here is my simple hack that forces the CLLocationMager to return the geocoords of Powell's Tech Bookstore only on the simulator: #ifdef TARGET_IPHONE_SIMULATOR @interface CLLocationManager (Simulator) @end @implementation CLLocationManager (Simulator) -(void

Location access - App is not asking for user permission to access location - iOS 11

痴心易碎 提交于 2019-11-26 16:46:08
问题 Description App is not asking for user permission to access location and getting state notDetermined Working perfectly till iOS-10 var locationManager : CLLocationManager! func getLocationDetails() { locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestAlwaysAuthorization() locationManager.allowsBackgroundLocationUpdates = true locationManager.startUpdatingLocation() } func locationManager(_ manager: CLLocationManager,

iOS CLLocationManager in a separate class

本秂侑毒 提交于 2019-11-26 15:38:51
问题 I have multiple view controllers that need to get the user's location, so I wanted to create a separate class that the ViewControllers can call to get the user's latest location. locationManager:didUpdateToLocation:fromLocation returns void. How do I pass the latitude and longitude data back to my ViewControllers as soon as the user's latitude and longitude is calculated? I could try writing getters and setters in my locationManaging class, but if I do that, how do I know when to call the

didFailWithError: Error Domain=kCLErrorDomain Code=0 “The operation couldn’t be completed. (kCLErrorDomain error 0.)”

梦想的初衷 提交于 2019-11-26 15:21:16
I want to get the current location, but instead I get an error. This is a snippet of my view controller. - (void)viewDidLoad { self.locationManager = [[CLLocationManager alloc] init]; [locationManager setDelegate:self]; [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters]; [locationManager startUpdatingLocation]; } - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations { // I would get the latest location here // but this method never gets called } - (void)locationManager:(CLLocationManager *)manager didFailWithError:

Will iOS region monitoring call didEnterRegion on my app if my app is in a terminated state?

那年仲夏 提交于 2019-11-26 14:37:32
问题 Will iOS region monitoring launch my app in the background if the user enters a region that was successfully being monitored for prior to the app being terminated? I know that the significant change API will do so and will let me know at launch time via the inclusion of the UIApplicationLaunchOptionsLocationKey key. If region monitoring will wake my app up out of a terminated state too, then what does the launch process look like? Is there a special key I should be looking for? 回答1: Yes, see

allowsBackgroundLocationUpdates in CLLocationManager in iOS9

本秂侑毒 提交于 2019-11-26 14:23:38
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? Felix This new property is explained in the WWDC session "What's New in Core Location" . The default value is NO if you link against iOS 9. If your app uses location in the background (without showing the blue status bar)

Start Location Manager in iOS 7 from background task

让人想犯罪 __ 提交于 2019-11-26 14:09:17
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 minutes. The idea was to run background task with a timer and start Location Manager when the timer triggers it. After that turn off Location Manager and start another background task. After updating to iOS 7 this approach does not work anymore. After starting Location Manager an app does not receive any locationManager:didUpdateLocations. Any ideas