core-location

startMonitoringForRegion never calls didEnterRegion/didExitRegion

核能气质少年 提交于 2019-11-30 00:44:26
I try to get the iPhone4 to monitor regions and notify me by call didEnterRegion or didExitRegion. I can't get it to work. I was reading probably all related enries here, plus a couple more articles on the web....iOS just don't call my CLLocationManagerDelegate methods. What did I do: I have a simple AppDelegate which implements also the CLLocationManagerDelegate methods for didEnterRegion and didExitRegion. Within these methods I simply use a UILocalNotification to report the event. From a ViewController I create a Region (the current Location) with aRadius of 1000meters. Here are some things

Location tracking stops after a while when app is in the background

落爺英雄遲暮 提交于 2019-11-29 23:03:13
I've created a simple app which tracks user location and creates local notification for every time location is updated. I enabled the background modes below, let locationManager = CLLocationManager() open override func viewDidLoad() { locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = 10 locationManager.allowsBackgroundLocationUpdates = true locationManager.startUpdatingLocation() } open func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let notification = UILocalNotification

Is it possible to use only region monitoring + GSM and to get not more than 5 km horizontalAccuracy?

霸气de小男生 提交于 2019-11-29 21:14:00
问题 I would like to share the info of my performed testing scenarios and to ask you to share your experience with region monitoring. So, I have registered two opposite regions (A and B) with 5 km radius and 1 km desiredAccuracy, with the 20 km distance between them. However, I haven't received any didEnterRegion/didExitRegion events when traveling from A to B. In my app prototype, I also put two buttons (for testing purposes): one starts significant change and another standard location monitoring

ios deferred location updates fail to defer

放肆的年华 提交于 2019-11-29 21:11:34
问题 I am looking into using deferred location updates for an iOS activity tracker, which allows location services in background. I've implemented the suggested code snippets (see below). In Xcode debugging, deferred locations attempt to start a few times until location data comes in at about 1 per second. After that, it claims to succeed in starting deferrals, and the callback for the finish trigger also succeeds after the specified time period expires. However during the time, the location

Decoding the CLLocationAccuracy const's

爱⌒轻易说出口 提交于 2019-11-29 20:08:11
the following are listed in CLLocation.h but from my experience they are deceiving names- possibly originally thought up to serve two purposes, 1. to test the accuracy of the location returned, but also 2. to set how hard the location manager works, specifically what is enabled (gps (how many sat channels), how hard the wifi works, triangulation etc. extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation; // (raw value: -2) extern const CLLocationAccuracy kCLLocationAccuracyBest; // (raw value: -1) extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters; // (raw value

Background GPS in iOS. Is this possible?

瘦欲@ 提交于 2019-11-29 19:45:24
I was wondering if it was possible to get the location of the iPhone with an app that isnt running, or at least running in the background. What I want to do is have the iPhone send a push notification when it arrives at a certain coordinate. Is this possible? If so, could someone put me in the right direction? Thanks, Ben Yes, it is possible. Your application can ask to be notified of significant location changes or to simply continue using the GPS while executing in the background. The former—the approach recommended by Apple—uses less power at the cost of accuracy ( this blog post indicates

What is the difference between “import” of framework and “linking” with framework?

懵懂的女人 提交于 2019-11-29 19:09:22
问题 I'm new in Xcode and in Swift language. I'm trying to understand the usage of the "import" in ViewController and the "framework import" in my project. Example: if I use CoreLocation , need I only import CoreLocation in my ViewController, or I need to import CoreLocation.framework in my project too? I saying this because everything works well only using import CoreLocation at the top of my ViewController, without import its framework. Thanks! 回答1: The import in the source code facilitates

How Can I Get Current Location on iOS? [duplicate]

耗尽温柔 提交于 2019-11-29 18:14:50
This question already has an answer here: how to get the current location position in map on iphone 2 answers I can't get current location. When I launch my app in different place, App can get last location. But I don't want to last location. If you close the app and restart it, now app can get current location. How can I get current location even if it is first launch of application? - (void)viewDidLoad { [super viewDidLoad]; [locationManager startUpdatingLocation]; self.mapView.delegate = self; [self.mapView setShowsUserLocation:YES]; locationManager.delegate=self; locationManager = [

Location services don't stop when application is terminated

半腔热情 提交于 2019-11-29 17:53:12
问题 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

error: server did not accept client registration 68

£可爱£侵袭症+ 提交于 2019-11-29 17:40:00
问题 I am trying to build and run the WhereamI.app example of the Big Nerd Ranch book: iOS Programming, chapter4. Compiling works just fine and it runs but the output to console is: server did not accept client registration 68, instead of providing the current GPS position and altitude. I am runing Xcode 4.1 on OS X Lion with the 4.3 SDK. There is nothing fancy at all in the code. JUst and instance of Corelocation manager and a simple delegation to WhereAmI.app Any clues? 回答1: I had the same