简体   繁体   中英

Significant location change

I have tried the significant location change in the latest iOS 8 update but the Core Location manager method

- (void)locationManager:(CLLocationManager *)manager
     didUpdateLocations:(NSArray *)locations

is never called.

When using method startUpdatingLocation the method above is called.

Everything worked in iOS 7 for the app. I need to update to iOS 8.

Share your experience.

I'm going to guess that you're not following the instructions here:

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_class/index.html#//apple_ref/occ/instm/CLLocationManager/startMonitoringSignificantLocationChanges

Events are going to be accumulated while your app is not running. Your app launches and must immediately create a location manager and start significant location updates all over again in order to receive that accumulated information.

如果要更新到iOS 8,请确保在属性列表(.plist)文件中进行更改:NSLocationWhenInUseUsageDescription和/或NSLocationAlwaysUsageDecription: http ://matthewfecher.com/app-development/getting-gps-location-using-core -location合IOS-8-VS-IOS-7 /

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM