cllocationmanager

Location Manager update frequency, iphone

天涯浪子 提交于 2019-11-26 23:22:22
问题 I have a CLLocation manager called "myLocation". myLocation = [[CLLocationManager alloc] init]; myLocation.desiredAccuracy = kCLLocationAccuracyBestForNavigation ; myLocation.distanceFilter = 10 ; myLocation.delegate=self; locationEnabledBool = [CLLocationManager locationServicesEnabled]; if (locationEnabledBool ==NO || ( [CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied)) { // LocationText.text = @"Location Service Disabled "; UIAlertView *locationAlert = [[UIAlertView

to run app continuously in the background

…衆ロ難τιáo~ 提交于 2019-11-26 23:17:14
问题 I want to my app to keep running in the background with location services. For this I have used: -(void)applicationDidEnterBackground:(UIApplication *)application { [locationManager stopUpdatingLocation]; [locationManager startUpdatingLocation]; //timer=[NSTimer scheduledTimerWithTimeInterval:300 target:self selector:@selector(UpdateLocation) userInfo:nil repeats:YES]; } but when I use NSTimer it does not call UpdateLocation . I tried calling it using another method but then it also called

Get location name from Latitude & Longitude in iOS

萝らか妹 提交于 2019-11-26 22:12:24
I want to find current location name from latitude and longitude, Here is my code snippet I tried but my log shows null value in all the places except in placemark , placemark.ISOcountryCode and placemark.country I want value of placemark.locality and placemark.subLocality but it is showing null values. - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // this creates the CCLocationManager that will find your current location locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy =

iPhone GPS in background never resumes after pause

可紊 提交于 2019-11-26 22:11:01
My application needs to track user location changes in the background and works fine as long as user moves around. When user stops and CLLocationManager pauses after 10-20 minutes or so. It is indicated by this notification: -(void)locationManagerDidPauseLocationUpdates:(CLLocationManager *)manager{} And this is also fine with me. Great, I save some battery, etc. The problem is that CLLocationManager never wakes up when user starts moving again and following delegate methods are never fired until I put my application to the foreground (gets active): //Never called back after CLLocationManager

How to stop multiple times method calling of didUpdateLocations() in ios

时间秒杀一切 提交于 2019-11-26 22:00:36
This my code...... -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { location_updated = [locations lastObject]; NSLog(@"updated coordinate are %@",location_updated); latitude1 = location_updated.coordinate.latitude; longitude1 = location_updated.coordinate.longitude; self.lblLat.text = [NSString stringWithFormat:@"%f",latitude1]; self.lblLon.text = [NSString stringWithFormat:@"%f",longitude1]; NSString *str = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&sensor=false",latitude1,longitude1]; url = [NSURL

CLLocationManager startUpdatingLocation not calling locationManager:didUpdateLocations: or locationManager:didFailWithError:

前提是你 提交于 2019-11-26 19:56:59
问题 I'm trying to use the CLLocationManager framework in my iOS project to access the user's location but when I call [locationManager startUpdatingLocation] neither locationManager:didUpdateLocations: or locationManager:didFailWithError: are getting called. //myViewController.h @interface myViewController : UITableViewController <CLLocationManagerDelegate> @end //myViewController.m @implementation myViewController{ CLLocationManager *locationManager; } //edit - (void)viewDidLoad { [super

iOS 8 Map Kit Obj-C Cannot Get Users Location

瘦欲@ 提交于 2019-11-26 19:36:06
I am working with Map Kit in iOS 8 using Obj-C NOT SWIFT. I cannot get the device location it is set a 0.00, 0.00 and I am getting the error: Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first. I have implemented: ( I have tried only one at a time and no luck ) if(IS_OS_8_OR_LATER) { [self.locationManager requestWhenInUseAuthorization]; [self.locationManager requestAlwaysAuthorization]; } [self.locationManager startUpdatingLocation]; And in

Region Monitoring Glitch on iOS 7 - Multiple Notifications at the same time

允我心安 提交于 2019-11-26 18:25:06
问题 I have been developing region monitoring on iOS for about 2 months. Recently we have found a glitch where all the regions within a certain radius (about 4.7KM or 4700 meters) triggered at the same time. The current location of the device is not even close to any of the regions. I am not sure what could have triggered that event. I have searched through StackOverFlow, Apple Developer forums and etc, I haven't find any similar issue with what I am facing. In the app that I am developing, we are

Implement CLLocationManagerDelegate methods in Swift

房东的猫 提交于 2019-11-26 18:06:34
问题 I've been trying to get this to work for awhile now, and I've come here to ask- how do I go about with using the CLLocationManagerDelegate methods in Swift? I've put this at the top of my class: var locationManager = CLLocationManager() I've put the following into my viewDidLoad method: locationManager.delegate = self locationManager.distanceFilter = kCLDistanceFilterNone locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.startUpdatingLocation() And I've tried using

Behaviour for significant change location API when terminated/suspended?

冷暖自知 提交于 2019-11-26 18:03:46
This is the section from the CLLocationManager documentation describing the app behavior with startMonitoringSignificantLocationChanges : 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 application:didFinishLaunchingWithOptions: method of your application delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your application was launched because of a location event. Upon relaunch, you must