core-location

iOs (CoreLocation) - locationManager:didUpdateLocations: not working as expected

会有一股神秘感。 提交于 2019-12-23 16:42:08
问题 I wrote a simple iPhone app that retrieves location information and simply display them. I want to increment the distanceTraveled variable every time the position changes. My problem is that in the method locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations , locations.count is always equal to one. I thought it would add an element to the array every time the method is called, but it seems not like that... I am running the application in the simulator (I don't

Getting time from GPS on iOS

故事扮演 提交于 2019-12-23 12:46:56
问题 I am working on a tracer app. The app requires to know the device location with high accuracy, i.e. it uses location services and ignores locations with horizontal accuracy worse than 20 meters. CLLocation does not declare explicitely if it was determined via GPS or not. However, if the horizontal accuracy is 20 meters or better, it can be supposed that it is a location from GPS. Additionally, I need to know the timestamp when the location was determined. I know about the property timestamp

How to continue tracking location after the user restarts the phone?

大憨熊 提交于 2019-12-23 12:27:30
问题 My application need to post the location data to my backend. I have set the location permissions to always and set the pausesLocationUpdatesAutomatically to false for CLLocationManager and need to continue tracking the phones location even when the application is in background or after the phone is restarted. I'm able to make it work when the application is in background mode. But it stops working when the phone is restarted. How can I do this? By the way, I know the 回答1: This is WELL

iphone/ipad dev - how to launch the system settings app programmatically

ぐ巨炮叔叔 提交于 2019-12-23 12:18:08
问题 In the settings -> general, there is a switch to turn on/off the location services. In the Maps app, when location services is off, if the user click on the find me button, it pops up an alert and asks the user to turn on location services in the settings. It then exits the app and launch the settings app. How can I do that programmatically in my app? 回答1: As of iOS 5.0 you can open the settings app programmatically using the "prefs://" URL scheme. You are out of luck on earlier versions. 回答2

didRangeBeacon called without any beacons found

荒凉一梦 提交于 2019-12-23 09:10:33
问题 I registered my own location manager to monitor and range a few beacons: [self.locationManager startMonitoringForRegion:region]; [self.locationManager startRangingBeaconsInRegion:region]; My understanding is, when one or more beacons is found this delegate method is called: - (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region This delegate method is indeed called when I turned on my beacon, but the beacons array is empty. Is

How to get multiple placemarks from CLGeocoder

笑着哭i 提交于 2019-12-23 09:04:05
问题 Whatever address i give to the geocoder ([geocoder geocodeAddressString:completionHandler:), it always puts only one object in the placemarks array. I there any way to get multiple results (like in Maps app) from which the user can select one? 回答1: I've done some sniffing on the packets and it seems that CLGeocoder doesn't connect to Google's geocoding service, but to Apple's. I've also noticed that I get only one placemark from there every time. If you want something more sophisticated you

iPhone: mapView.showUserLocation. VS locationUpdate function

↘锁芯ラ 提交于 2019-12-23 05:07:12
问题 I'm developing on an app that is location-based, I have a mapView set to show the user location (mapView.showUserLocation); I also have a locationUpdate function to retrieve lat/long of current position: (void)locationUpdate:(CLLocation *)location{} After I call the function stopUpdatingLocation to stop the update location, the mapview (blue ball) continues to update my location... In other word: is there another locationUpdate function is called automatically from the mapview? 回答1: I think

bluebar stays forever even if stopupdating is called in iOS 11

爷,独闯天下 提交于 2019-12-23 03:54:10
问题 I am accessing location services as 'always', i know all the changes made by apple in iOS 11. i updated my plist as required( added new key). I calling stopUpdatingLocation as soon as application goes to the background, but this blue still stays there saying your application is using location in the background. Top of that filled location icon in status bar changes to outlined location icon also. I am using Mapbox SDK as well. Is it a bug with iOS 11 or am i missing something? Just to give

CLLocationManager does not work for non-wireless connection?

前提是你 提交于 2019-12-23 03:54:09
问题 I have a Mac app and would like to use core location, however, when I am not on wifi but connected using an ethernet cable, core location (CLLocationManager) reports that the operation could not be completed. The exact error message is The operation couldn't be completed. (kCLErrorDomain error 0.) If I am always connected to the same router (ie. either wifi or ethernet cable) why does CLLocationManager only work for wifi and not for the ethernet connection? Any suggestions would greatly be

Reverse geocoding from given coordinates (not current location, but manually provided)

坚强是说给别人听的谎言 提交于 2019-12-23 02:58:09
问题 I am fetching GPS information of all my images and they are stored in a Dictionary. I would pass on the lat & long values from this dictionary to the reverseGeocodeLocation function call & store the results in my database. The problem here is that this function is an asynchronous call & I need to synchronize the whole process for my record to get inserted into the table. Eg: My array read following coordinates: 32.77003,96.87532. It now calls the reverseGeocodeLocation function, passing on