core-location

What strategy to adopt to monitor the user location in background?

爷,独闯天下 提交于 2021-02-19 05:23:18
问题 I want to track the user location in background , in the purpose to show him an alert when he is close to one of his friend. So i start with CLLocationManager . As far as i know their is only one reliable way to let the app know about the location update even if the user reboot the Iphone or kill the app: startMonitoringSignificantLocationChanges . But the problem is that even inside a city with many wifi, startMonitoringSignificantLocationChanges fire the DidUpdateLocations when the user

What strategy to adopt to monitor the user location in background?

℡╲_俬逩灬. 提交于 2021-02-19 05:23:06
问题 I want to track the user location in background , in the purpose to show him an alert when he is close to one of his friend. So i start with CLLocationManager . As far as i know their is only one reliable way to let the app know about the location update even if the user reboot the Iphone or kill the app: startMonitoringSignificantLocationChanges . But the problem is that even inside a city with many wifi, startMonitoringSignificantLocationChanges fire the DidUpdateLocations when the user

ios google maps accuracy

Deadly 提交于 2021-02-18 14:15:17
问题 i have view that display user current location using google maps and route to his distention. the problem: user location is out of the road most of the time, I can't put the app like this in the Appstore, it will get bad reviews. I checked google sdk for IOS, is there any property for accuracy !? like: self.googleMap.accuracy = bestForNavigation are there any tweaks or properties to set that improve user location accuracy? how maps apps on the Appstore display user location with so much

Is it possible to have a custom region shape? Core Location

六月ゝ 毕业季﹏ 提交于 2021-02-10 16:25:21
问题 For example at least I want a square/rectangle/ the shape of the road to be my region. 回答1: No it is not. As per the the documentation, currently the only region classes are CLCircularRegion, which is obviously circular, and CLBeaconRegion which is based on the proximity to an iBeacon. It is possible in the future that apple will add support for custom shaped regions but as of iOS 8, this is it. https://developer.apple.com/LIBRARY/ios/documentation/CoreLocation/Reference/CLRegion_class/index

Request location on the Apple Watch only, without code on the paired phone

你离开我真会死。 提交于 2021-02-07 11:54:55
问题 I've looked everywhere including Apple's sample app. But I can't find anywhere when I can request location without needing any code running on the phone, the below code when used in an 'interface controller' returns a "not determined" status. I did check that my info.plist has the privacy key values set. import Foundation import CoreLocation class LocationManager: NSObject, CLLocationManagerDelegate { /// Location manager to request authorization and location updates. let manager =

Alert view disappears on its own when calling [locationManager requestWhenInUseAuthorization];

让人想犯罪 __ 提交于 2021-02-06 14:22:02
问题 I'm calling [locationManager requestWhenInUseAuthorization]; on a screen that shows an MKMapView ( showsUserLocation = YES ). Which seems weird in the first place (Apple should handle this for MKMapView automatically, but XCode was complaining when I didn't do it). So I get the alert view that says the application wants to use your location, but then the alert view disappears on its own. Why does the alert view disappear on its own? Only thing I can think of is that I am calling

Unable Return String from CLGeocoder reverseGeocodeLocation

牧云@^-^@ 提交于 2021-02-05 07:57:13
问题 I want to write a function to reverse geocode a location and assign the resulting string into a variable. Following this post i've got something like this: extension CLLocation { func reverseGeocodeLocation(completion: (answer: String?) -> Void) { CLGeocoder().reverseGeocodeLocation(self) { if let error = $1 { print("[ERROR] \(error.localizedDescription)") return } if let a = $0?.last { guard let streetName = a.thoroughfare, let postal = a.postalCode, let city = a.locality else { return }

Unable Return String from CLGeocoder reverseGeocodeLocation

﹥>﹥吖頭↗ 提交于 2021-02-05 07:56:26
问题 I want to write a function to reverse geocode a location and assign the resulting string into a variable. Following this post i've got something like this: extension CLLocation { func reverseGeocodeLocation(completion: (answer: String?) -> Void) { CLGeocoder().reverseGeocodeLocation(self) { if let error = $1 { print("[ERROR] \(error.localizedDescription)") return } if let a = $0?.last { guard let streetName = a.thoroughfare, let postal = a.postalCode, let city = a.locality else { return }

WatchKit WatchOS - Location Services Prompt never displayed on the Apple Watch

怎甘沉沦 提交于 2021-01-29 20:02:28
问题 When I call requestWhenInUseAuthorization() from an Watch App, the Location Services prompt is never displayed to the user: neither in the Watch app, nor in the iPhone app. The Support Running Without iOS App Installation is not checked (if I check it, the prompt is correctly displayed, but I don't want my app to work without an iOS companion app). I added the NSLocationWhenInUseUsageDescription key in the info.plist of both the iPhone app and the Watch Extension. I also tried to add the

How does this app ask for background location permission immediately?

↘锁芯ラ 提交于 2021-01-28 06:12:52
问题 My understanding since iOS 13 is that background location permissions can only be granted by the user after they have already granted foreground location permissions, and the app is in the background, when a location event which would have triggered the app's background location occurs. At that point they get a dialog something like: Allow “App” to also access your location even when you are not using the app? Every app I've used has the same behaviour, except one app, which is able to