cllocationmanager

Trying to modify ckrecord in swift

心已入冬 提交于 2020-01-07 08:35:32
问题 I want the users' location to be updated in cloudkit but my code just save a new record every time. How can the existing record be modified or replaced by the new one? func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let location = locations.last let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude) let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta

How to get location services to reprompt the user for location permission if they accidentally refused it?

亡梦爱人 提交于 2020-01-04 06:08:18
问题 When the users are asked to allow the user location, if they select accidentally "NO", then this alert is never shown in our app. Is there any option to reprompt the alert every time they open the app.After referring S.O question, many are suggesting this not all possible.Only thing can be do is, we have alert the user to turn-on location service in settings. But in some S.O questions, starting CLLocationManager update method every time based on the user's selection we can reprompt the alert

How to disable system location alert in iOS simulator

扶醉桌前 提交于 2020-01-04 04:40:09
问题 I use KIF framework (http://github.com/kif-framework/KIF) with Xcode Continuous Integration Server for UI testing. When XCode CI server start app in iOS Simulator system alert "Application would like to use your current location" appears. I use this delegate - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus: (CLAuthorizationStatus)status to get the notification that user allows to use location and I need it to keep like it is. Is it possible to tap OK on this

How to continue monitoring iBeacon when screen is off in iOS?

不想你离开。 提交于 2020-01-04 01:19:08
问题 I am developing an iOS app to monitor iBeacons. It works well in both foreground and background. I also need it to keep monitoring even when the screen is off. Now my problem is, when I turn off the screen with the shoulder button, NSLog shows that the iBeacon signal goes off (RSSI=0, beacon.accuracy=-1.0) accordingly, and 10 seconds later, there is no beacon found at all, while the delegate method locationManager:didRangeBeacons:inRegion: is called continuously. It seems that the app is

locationManager:didUpdateLocations: always be called several times

大城市里の小女人 提交于 2020-01-03 10:56:36
问题 I start updating current location when the view did appear, and stop updating location whenever locationManager:didUpdateLocations: is called. But why the locationManager:didUpdateLocations: always be called several times? What have I missed? #import "ViewController.h" @interface ViewController (){ CLLocationManager *locationManager; // location manager for current location } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; } - (void)viewDidAppear:(BOOL)animated

CLLocationmanager setAuthorizationStatus doesn't work (jailbreak)

寵の児 提交于 2020-01-03 04:52:04
问题 I have jailbroken device with 6.1.3 iOS. Also I have command-line tool that should give me coordinates. Code that is about location works perfectly with normal application, but not in command line. I found similar question, but it doesn't seems to work: Get GPS without alert view with ROOT permission(jailbreak) - (void) start { NSLog(@"Started"); if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) { NSLog(@"%i", [CLLocationManager authorizationStatus]); } //

CLLocationmanager setAuthorizationStatus doesn't work (jailbreak)

ⅰ亾dé卋堺 提交于 2020-01-03 04:52:04
问题 I have jailbroken device with 6.1.3 iOS. Also I have command-line tool that should give me coordinates. Code that is about location works perfectly with normal application, but not in command line. I found similar question, but it doesn't seems to work: Get GPS without alert view with ROOT permission(jailbreak) - (void) start { NSLog(@"Started"); if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) { NSLog(@"%i", [CLLocationManager authorizationStatus]); } //

Proper way of using CLLocationManager (to start/stop updating user location)

Deadly 提交于 2020-01-03 04:14:18
问题 I have a UIView with an MKMapView , in a UIViewController, which appears only when user taps a button. The process is as follows: A CLLocationManager object is declared as private member in the header file. A UIView with an MKMapView is presented (initially the frame is outside bounds. Is moved to within view bounds on user's action, WITHIN THE SAME viewController ). It is initialized: locationManager = [[CLLocationManager alloc] init]; locationManager.distanceFilter = kCLDistanceFilterNone;

Location update in background and suspended app modes

喜夏-厌秋 提交于 2020-01-03 03:26:13
问题 I want to write application that every 5 min sends to server low-accuracy-location for its both modes: foreground and background. Because I don't want to reduce the battery charge and the locationSignificantChange gives only the high-accuracy-values, I start/stop locationUpdates from GPS every 5 min. Application works fine from foreground mode, but works only about 1 hour from background mode (and stops to send location afterwards). I guess I am missing something in backgroundTask/NSTimer

Not updating the current location in MKMapView

天大地大妈咪最大 提交于 2020-01-03 02:50:11
问题 I am using CLLocationManager to update the current location but some times the current location is lost. I don't know why the current location is losing. Please help me out of this. Thank you, Madan Mohan 回答1: The location can become lost for a wide variety of reasons: The device no longer has reasonably open access to the sky so GPS satellite information is unavailable. There aren't enough cell towers available to perform triangulation. The wifi access point isn't in the database of known