【问题标题】:iphone location method startMonitoringSignificantChanges fails to workiphone定位方法开始监控重大变化无法正常工作
【发布时间】:2010-11-26 13:12:45
【问题描述】:


我正在使用 iOS 4.2 SDK 为 iphone 开发应用程序。
当用户到达特定位置(半径 400 米)时,我的应用程序需要弹出警报。请注意,即使应用程序在背景中,我也需要收到此警报。
当我在 startUpdatingLocation 模式下使用 locationManager 时,我会在应用程序处于前台时收到警报,但在后台时不会收到警报。
当我尝试在 startMonitoringSignificantChanges 模式下使用 locationManager 运行时,我在后台甚至在前台都没有得到任何位置变化(即从不调用 didUpdateLocation 方法。仅在应用程序启动中一次) 一些事实:
1. 我使用 UIBackgroundMode 更新了 info.plist,并将“位置”作为数组中的第一项。
2. 我用 gps 和位置服务更新了 info.plist UIDeviceCapabilities(虽然这并不重要)
3. 以上都是指在 3GS iphone 设备上运行这个应用程序。
4. 我在 sdk 4.0 和 4.1 上尝试了这个应用程序并遇到了同样的问题。
5.设备支持startMonitoringSignificantChanges使用(locationManager方法确认)
6. 当我检查设备上的应用程序时,我的移动范围约为 150 米。 startMonitoringSignificantChanges 会不会用这种动作调用 didUpdateLocation 方法?
7.设备上的所有设置都打开模式(漫游,3G,wifi,...)

我错过了什么吗?有什么想法吗?
谢谢,

【问题讨论】:

  • 仍然没有找到答案...帮助..有人吗?

标签: iphone xcode localization gps multitasking


【解决方案1】:

如果您仍然感兴趣,请查看该帖子: Behaviour for significant change location API when terminated/suspended?

和提到的示例项目: http://www.cannonade.net/blog.php?id=1480

【讨论】: