cllocationmanager

how is it that CLLocationManager gets a location when Airplane Mode is ON

本小妞迷上赌 提交于 2019-12-08 03:05:51
问题 My app uses CLLocationManager to get location updates from the device. I had assumed that when the device was in Airplane Mode, I would not get location updates. But I do. The reason I assumed this is because Apple says that Airplane mode turns off Wifi, Cellular, Bluetooth, and GPS. See: http://support.apple.com/kb/ht1355 So, how is it that I'm getting a location update with a coordinate that seems reasonable? 回答1: I've developed an app that heavily uses the user location, so I had to check

iPhone: maximumElapsedTimeForCachedLocation used to remove cache value of core location

混江龙づ霸主 提交于 2019-12-08 02:57:54
问题 In certain cases, cached values are immediately returned when starting a location service. Any location with a time interval older than this value will be considered invalid. @property (nonatomic, assign) NSTimeInterval maximumElapsedTimeForCachedLocation Declared In UABaseLocationProvider.h Do any of you know how to use this maximumElapsedTimeForCachedLocation in Core Location for removing the cache value of the old location? 来源: https://stackoverflow.com/questions/12909910/iphone

didUpdateToLocation is not called

*爱你&永不变心* 提交于 2019-12-08 02:43:27
问题 I want to receive location updates. I have added a location delegate to the header: @interface AppDelegate : UIResponder <UIApplicationDelegate, CLLocationManagerDelegate> and the following functions: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //initialize location manager CLLocationManager* locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; // [locationManager

CLLocationManager and tvOS - RequestWhenInUseAuthorization() not prompting

不打扰是莪最后的温柔 提交于 2019-12-08 00:57:15
问题 I seem to be having a little trouble getting tvOS to prompt the user for location data authorization. I literally copied and pasted working code from iOS and it seems to not be prompting the user. I am using the code listed below as well as the NSLocationWhenInUseUsageDescription key with a string value. The only difference in the api that I see is on iOS it uses startupdatinglocation() and on tvOS it uses requestLocation() (similar to watchOS) I've stepped through the problem and it is

What is CoreLocation's Region Monitoring system defined cushion?

折月煮酒 提交于 2019-12-08 00:08:52
问题 I'm using the simulator to test region monitoring. Using CoreLocation with region monitoring and the Freeway Drive test location path in the Simulator (Debug > Location > Freeway Drive) I'm able to simulate, at least visually the path of the Freeway Drive as it intersects with various overlays. Those overlays are converted to regions and monitored as soon as I start monitoring the user's location. Anyway, this doesn't seem to work very well. The regions represented by my overlays don't cause

Reducing the threshold of didEnterRegion

有些话、适合烂在心里 提交于 2019-12-07 16:36:26
I'm currently working on an app that I want for my app to detect a beacon in background mode just when it gets close to it(Immediate). Based on articles that I've read it cannot be done with didEnterRegion and I should use ranging while it's running in the background mode(Location Update). is there any solution that directly reduces the didEnterRegion threshold? or Should I use the other method? and if that's the case does it work like didEnterRegion but with a limited range of RSSI? does it work when my phone entered the region and it's locked and the screen is off? Monitoring APIs give you

iOS. CLLocationManager receives location update only once in didUpdateLocations

你离开我真会死。 提交于 2019-12-07 13:27:02
问题 I have the following code to get location updates (iOS 7): import UIKit import CoreLocation class FirstViewController: UIViewController, CLLocationManagerDelegate { var locationManager: CLLocationManager! override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func startTracking(sender : AnyObject) { NSLog("Start tracking") if (locationManager == nil) { locationManager = CLLocationManager() locationManager

iOS 8 - Can't get current location, Error Domain=kCLErrorDomain Code=0

◇◆丶佛笑我妖孽 提交于 2019-12-07 11:12:14
问题 I've problem with getting my current location. I still getting error: Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)" I already did everything that I found here: Reset content and settings in iOS Simulator (map application in simulator shows correct location). In Xcode at Product>Scheme>Edit I unmarked Allow Location Simulation (when I mark it,It simulate e.g. London). I have added NSLocationWhenInUseUsageDescription to Info.plist file in my

didUpdateToLocation doesn't gets called immediately

℡╲_俬逩灬. 提交于 2019-12-07 09:13:33
I am using startMonitoringSignificantLocationChanges for getting the (lat,lon) values.My problem is (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation method doesn't gets called immediately after [locationMangerObject startMonitoringSignificantLocationChanges]; is encountered.Inside didUpdateToLocation method only i maintain two global double variables for holding latitude and longitude which will be set from the coordinates obtained from didUpdateToLocation method.These values are passed to the webservice

significant location change does not trigger at least every 15min

倾然丶 夕夏残阳落幕 提交于 2019-12-07 07:07:05
问题 According to apple docs, significant location change should update location at least every 15min. I am indeed receiving updates when I move significantly, but not when the device is stationary. What is your experience with updates? Do they come at least every 15min? If GPS-level accuracy isn’t critical for your app and you don’t need continuous tracking, you can use the significant-change location service. It’s crucial that you use the significant-change location service correctly, because it