core-location

Location services don't stop when application is terminated

倖福魔咒の 提交于 2019-11-30 12:26:06
I'm currently developing an iPhone application which needs location services for various use including AR. I test everything on simulator and on my iPhone 3GS and everything went well. I recently tested on iPhone4 and on iPad2 and the location service (the little icon in status bar) keeps displaying even when I manually kill the app! The only way to disable this icon is to manually stop the location service for my app in the settings. Does anyone know something about this? If needed I can post my code. Thank you in advance Edit : When I kill the application, go to location services, switch off

iPhone SDK 6 Launching maps with voice navigation directions

二次信任 提交于 2019-11-30 10:51:12
I am trying to launch the maps app from my iPhone SDK app. Right now I can launch the maps app with directions but it goes to an overview of the directions and doesn't use Siri and the voice navigation to give turn by turn directions. currently I have a button that launches this code... NSString *address = viewedObject.addressFull; NSString *url = [NSString stringWithFormat: @"http://maps.apple.com/maps?saddr=%f,%f&daddr=%@", here.latitude, here.longitude, [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString

How to keep GPS app running in background without pauses

给你一囗甜甜゛ 提交于 2019-11-30 10:39:45
I have a problem keeping the GPS running in background. I succeded to keep the GPS running when the app is in background, but it stops sometimes. I noticed that it stops when i enter in a building and i stay there for 2-3 hours. "Stops" means that i don't receive any GPS point even though the location service icon is still on. Then when i get out i don't receive any points until I bring my application to foreground. I set the pausesLocationUpdatesAutomatically property to NO. So, everything works fine until i get into a location with weak gps signal. When i get out of that area i don't receive

If background applications can't launch automatically how does Cardcase launch on a location change?

两盒软妹~` 提交于 2019-11-30 10:35:24
The Cardcase application lets you know if you approach a shop which you have a previous relationship with (if you've set up a tab for payments there etc.). If background running applications cannot be started automatically on device boot, how does this app therefore work? Edited to make my question clearer: I am not asking how to monitor for location changes or how to monitor for location changes in the background. My question is, if the user install this app, then adds some tabs for some locations, then they reboot their iPhone, then how can this app subsequently notify them when they

Core Location not requesting user permission

心已入冬 提交于 2019-11-30 10:34:19
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. Not many people know this, but after you uninstall an application, that application's documents and preferences are still stored on the device, here: /var/mobile

Determining if user has denied CoreLocation permission

£可爱£侵袭症+ 提交于 2019-11-30 09:50:21
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? 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, kCLAuthorizationStatusAuthorized } CLAuthorizationStatus; The system will prompt the user to authorize your application if the

iOS CoreLocation Altitude

坚强是说给别人听的谎言 提交于 2019-11-30 09:03:57
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 stringWithFormat:@"%i", newLocation.altitude]; /* theres more code, but it's not relevant, and this worked prior to

How do I debug an iPhone app that's supposed to be launched by location services, into the background, from a terminated state?

人走茶凉 提交于 2019-11-30 08:18:57
We're told, via Apple's docs on startMonitoringSignificantLocationChanges that the following behavior can be expected by an application using the signification change API: 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 locationManager:didUpdateLocations: method of your application delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your application was launched because of a location event.

requestAlwaysAuthorization not showing permission alert

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 08:10:41
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 = [[CLLocationManager alloc]init]; self.locManager.delegate = self; [self.locManager

How to measure the distance in meters between two CLLocations?

白昼怎懂夜的黑 提交于 2019-11-30 08:01:16
问题 How can I get the distance in meters between two CLLocation s? CLLocation doesn't provide any method to do it, it seeems. 回答1: CLLocationDistance distance = [aCLLocationA distanceFromLocation:aCLLocationB]; // distance is a double representing the distance in meters 回答2: CLLocationDistance distance = [secondLocation distanceFromLocation:firstLocation]; // distance is expressed in meters CLLocationDistance kilometers = distance / 1000.0; // or you can also use this.. CLLocationDistance meters