【发布时间】:2013-05-28 08:29:19
【问题描述】:
由于 iPod touch 没有 GPS,它在呼叫CLLocationManager startMonitoringSignificantLocationChanges 时是否真的提示位置访问?
【问题讨论】:
标签: ios objective-c cllocationmanager ipod-touch
由于 iPod touch 没有 GPS,它在呼叫CLLocationManager startMonitoringSignificantLocationChanges 时是否真的提示位置访问?
【问题讨论】:
标签: ios objective-c cllocationmanager ipod-touch
显着的位置变化仅适用于配备蜂窝网络芯片的设备(iPhone、配备蜂窝网络的 iPad)。它使用手机信号塔来检查是否有重大移动。
如果您尝试在 iPod Touch 上使用 startMonitoringSignificantLocationChanges,它只会默默地失败。它永远不会要求用户允许位置服务。它甚至不会调用locationManager:didFailWithError: 方法。
最好的办法是使用+significantLocationChangeMonitoringAvailable 将您的电话包裹在支票中
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
if ([CLLocationManager significantLocationChangeMonitoringAvailable]) {
[locationManager startMonitoringSignificantLocationChanges];
} else {
NSLog(@"Can't monitor significant location changes");
}
【讨论】:
iPod touch 可以通过对 Wifi 热点进行三角测量来获取其位置 - 它仍然是用户的位置,因此仍会询问用户是否真的希望 Bob's Money Stealer 找到他们的位置。
【讨论】: