【发布时间】:2015-05-02 18:15:12
【问题描述】:
我正在使用以下代码进行定位-
self.locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy=500;
locationManager.distanceFilter=kCLLocationAccuracyKilometer;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([locationManager respondsToSelector:@selector(requestAlwaysAuthorization)])
{
[locationManager requestAlwaysAuthorization];
}
#else
#endif
[locationManager startUpdatingLocation];
//Disable auto location pause in background
if ([self.locationManager respondsToSelector:@selector(pausesLocationUpdatesAutomatically)])
{
self.locationManager.pausesLocationUpdatesAutomatically = NO;
}
在我的 plist 文件中,我将“应用程序注册以进行位置更新”作为“必需的后台模式”。但是苹果拒绝了我的申请,并说如果你在后台使用位置,你必须使用实时位置更新。
如果我想在背景中使用具有距离过滤器的位置,请告诉我需要使用什么。
【问题讨论】: