core-location

Example for startMonitoringSignificantLocationChanges

假如想象 提交于 2019-11-27 21:02:44
问题 I am new to iPhone programming. I am looking for an example or a demo on how to use startMonitoringSignificantLocationChanges method with the CoreLocation Manager. I am confused by the documentation because, I am not sure if the same delegate method is called as in the case of invoking startUpdatingLocation . (i.e. the delegate locationManager: (CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation: (CLLocation *)oldLocation is called) Any help on this would

How to solve Xcode 4.1 (LION) GPS error?

穿精又带淫゛_ 提交于 2019-11-27 19:54:03
问题 My project worked perfectly on simulator+device, but now, after upgrading to lion os and xcode 4.1 , I get this error when gps is active! server did not accept client registration 68 It's a gps based application, and i'm nervous to not debug app in simulator! Any idea to solve this issue? UPDATE : Gps on Simulator doesn't work also on Xcode 3.2.6 + LION. EDIT : Apple response on bug tracker: After further investigation it has been determined that this is a known issue, which is currently

What do horizontalAccuracy and verticalAccuracy of a CLLocation refer to?

冷暖自知 提交于 2019-11-27 19:37:08
I've been working on a location based app recently and am noticing some strange values for CLLocation. I often get a horizontalAccuracy of 1414 and a verticalAccuracy of -1 . Any clue what this indicates? As far as I can tell, these points are often very accurate. What is the difference between verticalAccuracy and horizontalAccuracy? The -1 for verticalAccuracy indicates that the altitude in the CLLocation is not valid. You only get altitude with a 3D GPS position. The 1414 for horizontalAccuracy indicates that the horizontal (lat/lon) position could be up to 1414m off (this is just an

Run a Swift 2.0 app forever in background to update location to server

爷,独闯天下 提交于 2019-11-27 19:11:29
I have written the below code that has a timer that calls a callback function every minute. When the app goes to the background I have started another timer that calls the same callback method, but the background timer works for only three minutes. I understand that Apple allows background tasks for only three minutes. My app is more like a tracking app that tracks the location of the user every minute even when the app is in background, so I need to implement this functionality. I learned that beginBackgroundTaskWithExpirationHandler is to be used but I don't know whether my implementation is

CLLocationManager didEnterRegion: with iBeacon while app is suspended

一世执手 提交于 2019-11-27 18:59:25
问题 I'm trying to wake up my app (relaunch it) when it enters my defined beacon region but I just can't get it to work. This are the steps and code I'm using. Set "Location updates" Background Mode to YES. Monitor my CLBeaconRegion NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"EBEFD083-70A2-47C8-9837-E7B5634DF524"]; beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"daRegion"]; beaconRegion.notifyEntryStateOnDisplay = NO; beaconRegion.notifyOnEntry = YES;

Detecting if a user is moving in a car

安稳与你 提交于 2019-11-27 17:24:11
NOTICE : This question was originally posted before Apple introduced motion-detection hardware and associated APIs in the iOS SDK. Answers to this question, however, remain relevant. I'm creating an iPhone iOS app which involves tracking a user's running and / or walking. It is very important that the recorded results of the users runs and walks remain honest. I need a way to catch a user who may be cheating (or accidentally have left the tracker on) when using a car. To check if the user is driving or riding in a car I first thought of these two checks, however neither can really determine if

HowTo initialise MKMapView with a given user location?

ⅰ亾dé卋堺 提交于 2019-11-27 17:13:38
My app knows the current user position (CoreLocation.framework). As soon as the user opens a new MapView his iPhone starts searching for the current position again. Is it possible to skip that or to change the first user position for mkMapView? Edit: Is it possible to overwrite MKMapView and use an other LocationManager? Yes, it is possible to have a separate location manager object and assign its value to the mapview (BTW, I'm using '=' below as list prefix to prevent the SO code-formatter from borking). = In your UIViewController maintain two separate properties: one to a MKMapView and one

NSUserDefaults losing its keys & values when phone is rebooted but not unlocked

不羁的心 提交于 2019-11-27 16:59:56
We are currently experiencing the following weird issue with our iPhone app. As the title says, NSUserDefaults is losing our custom keys and values when phone is rebooted but not unlocked, and this is happening on a very specific scenario. Context: We are using the NSUserDefaults in the app to store user data (e.g. username). Our app has Location enabled on Background Mode. We are experiencing this issue only when distributing over the air or by Testflight. If I drag and drop the .ipa (same that was distributed over the air) into my phone using Xcode I don't experience this issue. Situation:

iOS - CoreLocation and geofencing while app is closed

南笙酒味 提交于 2019-11-27 16:57:11
I've read many tutorials about geofencing my iOS app (i.e., here ), but none mention whether or not iOS allows any app-specific location data to be handled when the app is closed. For instance, I understand that when the app is in the background, these services will still persist (if coded correctly), but how about when the user double taps the home button and closes the app? Can location data still be obtained? According to the Apple Documentation , in the Using Regions to Monitor Boundary Crossings section: In iOS, the regions you register with the location manager persist between launches

In iOS, what is the difference between the Magnetic Field values from the Core Location and Core Motion frameworks?

心已入冬 提交于 2019-11-27 16:52:52
I have two ways of getting the magnetic fields (strength, x, y, and z) using the iOS device's magnetometer. 1) Core Location Used the CLHeading from CLLocationManagerDelegate method locationManager:didUpdateHeading: . This is similar to Apple's Teslameter sample app. 2) Core Motion Used CMMagneticField from CMMotionManager 's magnetometerData.magneticField . Questions: a) What is the difference between the two? I am getting different values from both. I was expecting that they will return the same values. The difference is most notable when I start the app from a resting position (face up in a