cllocationmanager

How to check if location services are enabled for a particular app prior to iOS 4.2?

余生颓废 提交于 2019-11-28 17:09:01
问题 How can I check if the user has allowed location for mu app? Normally I would use authorizationStatus method of the CLLocationManager class, but it is only available in iOS 4.2 and newer. Is it possible to achieve this somehow while still using SDK 4.2, so that the app can still run on devices with older versions of iOS, or do I have to downgrade the SDK? And along the same line, I need a similar alternative for the locationServicesEnabled method prior to iOS 4.0. 回答1: When you call

iPhone CLLocationManager updates every 0.5 seconds

前提是你 提交于 2019-11-28 14:18:15
For an app that does lots of calculation from the GPS, I need to get the latitude/longitude and speed every 0.5 second to be very accurate and avoid delay. I am using: [locationManager setDesiredAccuracy:kCLLocationAccuracyBestForNavigation]; - locationManager:didUpdateToLocation:fromLocation: function to store the value in 3 variables: newLatitude , newLongitude and newSpeed An NSTimer object that call a function every 0.5 second. See below a graph generated by Excel representing the latitude values during 18 seconds: We can clearly see that we have location updates every second, and not

Swift 2 – Can't get user location with CLLocationManager

馋奶兔 提交于 2019-11-28 14:06:34
Here is my VC code: import UIKit import MapKit import CoreLocation class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate { @IBOutlet weak var mapView: MKMapView! let locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() locationManager.delegate = self locationManager.requestWhenInUseAuthorization() mapView.showsUserLocation = true } func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus) { mapView.showsUserLocation = (status == .AuthorizedAlways) } func locationManager(manager:

ios getting my location regularly and setting button to get my location - Google Map not working

核能气质少年 提交于 2019-11-28 13:08:49
I am working on Google Map Module , using 1.9.0 Bundle, to find my location on regular basis , say 10 seconds and create a button to get my location button as one of mapview settings When it comes to the execution and location service is turned on, there are no responses after clicking the right bottom button or not, the location manager is not working. I can show any signs of using location service. I am not sure what I am missing on setting this map as i follows strictly on the SDKDemos - ios google demo project to set my module. Would you please tell me the exact way to set it ? The

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

♀尐吖头ヾ 提交于 2019-11-28 11:48:38
问题 This question already has answers here : how to get the current location position in map on iphone (2 answers) Closed 6 years ago . 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];

iOS7 Core Location not updating

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 11:01:56
I have a very simple app example that initialises and updates the users location.. On device it successfully throws another callback location every second or so however on device (iPhone running iOS7) is calls the method once and then mysteriously stops... //Setup Location Manager in ViewDidLoad locationManager = [[CLLocationManager alloc] init]; [locationManager setDistanceFilter:kCLDistanceFilterNone]; [locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; [locationManager setDelegate:self]; [locationManager startUpdatingLocation]; -(void)locationManager:(CLLocationManager *)manager

why self.locationManager stopUpdatingLocation doesn't stop location update

牧云@^-^@ 提交于 2019-11-28 10:44:20
Problem : It seems I can't stop Core Location from sending updates to my app / tracking. What am I doing : In my viewWillAppear I call self.locationManager and pass it to a method to show user's location on the map (an instance of MKMapView ). The getter is overridden to check for availability of the serive, to see whether its authorized. If so, it allocs/inits and startMonitoringSignificantLocationChanges and returns . In viewDidDisappear , I call [self.locationManager stopUpdatingLocation] . But still I can see the location icon in the status bar. Even when I terminate the app by double

Location indicator persists on status bar after stopUpdatingLocation is called, but only for old Bundle Identifier

喜欢而已 提交于 2019-11-28 08:57:17
问题 Does any one know why the location indicator stay on for certain bundle identifer vs. the others? I am using an Apple sample LocateMe app, installed on my iOS device running version 5.0.1. When I'm using an old bundle identifier, the location indicator stays on the status bar, after the CLLocationManager stopUpdatingLocation is being call. But, when I'm using the same exact app, with the only difference being a new bundle id, the app works as expected and the location indicator disappear once

iOS 6 and Location Services not working

杀马特。学长 韩版系。学妹 提交于 2019-11-28 08:43:40
I've updated my iOS SDK to version 6. After that I've compiled my app (works fine in iOS 4 & iOS 5 ) but now the location services doesn't work. My delegate isn't receiving any update and the upper location arrow is not appearing... I'm starting the service as the usual way: [locationManager startUpdatingLocation]; My project is non ARC. What is happening? This is driving me crazy... Thanks in advance. Make sure you have a CFBundleDisplayName in your project's .plist file. Adding that key fixed it for me. Just set the property pausesLocationUpdatesAutomatically of Location Manager to NO . This

CLLocationManager authorization issue iOS 8

笑着哭i 提交于 2019-11-28 08:22:10
I am working on a piece of Swift code for iOS 8. I am trying to do something which involves location, and so i have implemented the following in my swift view controller file: let locationManger:CLLocationManager = CLLocationManager() var speedReceived:Double = 0 override func viewDidLoad() { super.viewDidLoad() locationManger.delegate = self locationManger.desiredAccuracy = kCLLocationAccuracyBest let authstate = CLLocationManager.authorizationStatus() if(authstate == CLAuthorizationStatus.NotDetermined){ println("Not Authorised") locationManger.requestWhenInUseAuthorization() } // Do any