cllocationmanager

CLLocationManager requestWhenInUseAuthorization() not working

独自空忆成欢 提交于 2019-12-01 18:52:57
I am trying to use location services in my iOS app but for some reason requestWhenInUseAuthorization is not working. When the user first uses the app, the prompt comes up as normal asking for permissions but then when you open the app a second time, for some reason didChangeAuthorizationStatus method is not called so I cannot display the user current location on the map. My code is below: override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib locationManager.delegate = self locationManager.requestWhenInUseAuthorization() var

How to calculate elevation like in runkeeper application

Deadly 提交于 2019-12-01 13:04:41
问题 I have application that track user movement. And I store all relevant data lat/lng/alt etc. I am trying add elevation like on runkeeper just without graphic I need just to get elevation value. In my .h file: @property (nonatomic) double netElevationLoss; @property (nonatomic) double netElevationGain; @property (nonatomic) double netElevationChange; In my .m file: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *

Implementing Periodic Location Updates in iOS even if app gets terminated

五迷三道 提交于 2019-12-01 12:36:25
My application requires periodic location updates (every 10 minutes). In foreground and background (app not terminated) the application is working correctly. But the problem starts to occur when the app is terminated by the user. I tried using this tutorial http://mobileoop.com/getting-location-updates-for-ios-7-and-8-when-the-app-is-killedterminatedsuspended . It works only when user's location is changing because of startMonitoringSignificantLocationChanges . But I need locations in terminated state even if user is not changing its location. Also, I have tried most of the stackoverflow

Function “didUpdateToLocation” being called without changes

旧城冷巷雨未停 提交于 2019-12-01 11:59:20
I initialize the locationManager this way: if (!self.locManager) { self.locManager = [[CLLocationManager alloc] init]; self.locManager.delegate = self; [locManager startMonitoringSignificantLocationChanges]; } my device is not moving and still "didUpdateToLocation" is being called every time. What could be a problem? Thanks didUpdateToLocation may update for a number of reasons, a good strategy for handling this is to gradually filter results based on timestamp, then required accuracy. Apple provide a good example in the LocateMe sample app : - (void)locationManager:(CLLocationManager *

Location service going to “Inactive” state in iPhone 5

有些话、适合烂在心里 提交于 2019-12-01 11:15:37
Even my app is register for Location updates in background. In my code: self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers; self.locationManager.distanceFilter = 2500; And I not moved anywhere. So after exactly 15 minutes in console log I got this message "Location icon should now be in state 'Inactive'" . From this point onwards my app is not running in background. It's happening in iPhone 5 only. @updated Here is my code self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; [self.locationManager setPurpose:@"Enable Location

CLLocationManager didUpdateLocations not being called

China☆狼群 提交于 2019-12-01 11:10:51
I am in the process of learning iOS 8 app development with Swift. I have followed a tutorial on Treehouse that walks you through building a weather app in Swift and iOS 8. As an improvement to the app, the author/tutor suggests using CLLocationManager to get the location of the device to feed into the weather API instead of the hard coded latitude and longitude values. So having read various tutorial online, I have gone ahead and attempted to implement this suggested improvement. I have placed the code responsible for getting the location coordinates inside the AppDelegate.swift file.

Location Services not working in iOS 6 [duplicate]

非 Y 不嫁゛ 提交于 2019-12-01 11:01:55
Possible Duplicate: iOS 6 and Location Services not working Our app's location services have stopped functioning in iOS 6. They work fine in iOS 5. When I call CLLocationManager's startUpdatingLocation method it never prompts the user for access and our app doesn't show up in the Settings Location Services page. Anyone seen this before? I really have no idea where to look. I have tried stripping down our app to just a single view controller and it still doesn't work. Maybe something in the build settings? Edit: I created a new target and it works in there. It looks like the problem was we did

Function “didUpdateToLocation” being called without changes

て烟熏妆下的殇ゞ 提交于 2019-12-01 10:21:49
问题 I initialize the locationManager this way: if (!self.locManager) { self.locManager = [[CLLocationManager alloc] init]; self.locManager.delegate = self; [locManager startMonitoringSignificantLocationChanges]; } my device is not moving and still "didUpdateToLocation" is being called every time. What could be a problem? Thanks 回答1: didUpdateToLocation may update for a number of reasons, a good strategy for handling this is to gradually filter results based on timestamp, then required accuracy.

how to get the current gps coordinates in xamarin

六月ゝ 毕业季﹏ 提交于 2019-12-01 10:03:43
问题 I would like to get the user's current latitude and longitude for ios in xamarin. I've looked at other posts and as i understand it. it's like: CLLocationManager lm = new CLLocationManager(); ... (Acurray) ... (Other Specs) lm.StartUpdatingLocation(); lm.Location.Coordinate.Latitude.ToString(); lm.Location.Coordinate.Longitude.ToString(); However, when i run it in the simulator it doesn't do anything. It doesn't ask me to turn on my location services or update my Label with the latitude and

Grey GPS arrow shown in statusbar although location based application killed using Fast App Switcher

て烟熏妆下的殇ゞ 提交于 2019-12-01 08:20:28
I am writing a location based application for iOS 5. The application is using the CLLocationManager to receive Location updates. When the application is started I am creating the LocationManager, calling [self.locationManager startUpdatingLocation]; and the grey location arrow appears in the statusbar. When the application enters background I am calling [self.locationManager stopUpdatingLocation]; [self.locationManager startMonitoringSignificantLocationChanges]; cause I just want to receive significant location changes while the app is in background. The grey location arrow is still shown. I