core-location

Is it possible to call alert “Allow to use current location” manually?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 16:04:53
Is it possible to call alert "Allow to use current location" manually when using CoreLocation framework? Ortwin Gentz No, it's automatically displayed when the app accesses Core Location. If the user rejects it, it's displayed a second time at the next launch, then it keeps quiet and isn't shown anymore. See this answer how to detect if the user rejected the request . 来源: https://stackoverflow.com/questions/3749648/is-it-possible-to-call-alert-allow-to-use-current-location-manually

Significant Location Changes - What guarantees do we have?

一曲冷凌霜 提交于 2019-11-29 15:39:52
问题 I'm currently writing a Mobile iOS app that is using the iOS Significant Location Change service to manage lots and lots of geofences, enabling and disabling geofences as we receive this message from the CoreLocation Framework. On the Apple Developer Website it says: The significant-change location service delivers updates only when there has been a significant change in the device’s location, such as 500 meters or more. What really throws me off is "500 meters or more", what exactly is the

Core Location not requesting user permission

大兔子大兔子 提交于 2019-11-29 15:22:17
问题 An application I was testing asked for user location on first device launch. I have uninstalled the application, deleted the build folder, and cleaned all targets, but core location never requests permission again. It is just off and must be enabled in the users settings. Any idea why the users choice would remain persistent even after the application was uninstalled? Very weird behavior, worried it may get me rejected for the store. 回答1: Not many people know this, but after you uninstall an

Determining if user has denied CoreLocation permission

只谈情不闲聊 提交于 2019-11-29 14:26:06
问题 Is it possible to determine programmatically that a user has denied permission to use their location? Secondly, if a user has denied permission, is it possible to re-prompt the user? 回答1: You can determine your authorization status using the authorizationStatus class method on CLLocationManager . This returns a CLAuthorizationStatus which is defined as: typedef enum { kCLAuthorizationStatusNotDetermined = 0, kCLAuthorizationStatusRestricted, kCLAuthorizationStatusDenied,

iOS CoreLocation Altitude

点点圈 提交于 2019-11-29 14:02:18
问题 Prior to iOS 4.0, CoreLocation was reporting altitude correctly, now it always reports as 0 ft. -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation *)oldLocation { NSString *tLatitude = [NSString stringWithFormat:@"%3.5f", newLocation.coordinate.latitude]; NSString *tLongitude = [NSString stringWithFormat:@"%3.5f", newLocation.coordinate.longitude]; /* the following returns 0 */ NSString *tAltitude = [NSString

Persisting CoreLocation

我怕爱的太早我们不能终老 提交于 2019-11-29 12:54:59
I have a need to store the current location to 'disk' on the iphone if the application I'm writing is terminated. Then, when the app starts again, I want to restore this information. However, the CLLocation coordinate property is read only. What can I do to save this information between program invocations (and reapply it to a CLLocation object)? You could use NSDefaults to store it. Something like #define kLocationLat @"LOCATION_LAT" #define kLocationLng @"LOCATION_LNG" // Store the location [[NSUserDefaults standardUserDefaults] setDouble:location.coordinate.lat forKey:kLocationLat]; [

CLLocationDegrees initialization

橙三吉。 提交于 2019-11-29 12:37:46
问题 How do you make a CLLocationDegrees? It's not a float, so what is it? 回答1: According to the CLLocation documentation, CLLocationDegrees is simply a double. So to create one, you could do something as simple as this: CLLocationDegrees degrees = 45; 回答2: CLLocationDegrees are typedefed doubles: http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html#//apple_ref/doc/uid/TP40007126-CH3-SW19 ex: CLLocationDegrees myDegrees = 2

Corelocation and assisted gps iPhone

被刻印的时光 ゝ 提交于 2019-11-29 12:03:30
I have a quick question, does the core location in iOS 4.3.2 automatically use assisted gps or is this an option you need to choose. I am working with the GPS and I recon that the settle time before finding a good accuracy(below 10 meters) is rather long - a few minuts. Regards Bjarke It's all automatic. The best you can do is check the altitude, which is undefined when a GPS fix is not available yet. edit: see http://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html if verticalAccuracy < 0, altitude is invalid (from which you can

Corelocation incorrect distances

强颜欢笑 提交于 2019-11-29 11:10:00
I am developing an application which computes the distance traveled by the user. I am using CLLocationManager class to do so, but I am getting the cached data initially and also the distance variable is increasing at a sudden rate. Please help me out... I have used the following code.... Note:distance is a static var. here - (void)viewDidLoad { [super viewDidLoad]; //bestEffortAtLocation = nil; oldLocat = [[CLLocation alloc]init]; newLocat = [[CLLocation alloc]init]; locationManager =[[CLLocationManager alloc]init]; locationManager.delegate = self; locationManager.distanceFilter =

requestAlwaysAuthorization not showing permission alert

為{幸葍}努か 提交于 2019-11-29 10:50:10
问题 I'm trying to use some fancy iBeacons without success, kCLAuthorizationStatusNotDetermined all time. According to other questions it's a requirement to add those keys to info.plist (some questions says one, other says both). According to an article for iBeacons I need the Always option. <key>NSLocationWhenInUseUsageDescription</key> <string>Nothing to say</string> <key>NSLocationAlwaysUsageDescription</key> <string>Permiso para acceder siempre</string> At viewDidAppear: self.locManager = [