简体   繁体   English

iOS重大更改位置事件不会每15分钟更新一次应用

[英]iOS Significant-Change Location event doesn't update the app every 15 mins

According to the documentation : 根据文档

Significant-change location updates wake the system and your app once every 15 minutes, at minimum, even if no location changes have occurred. 重大更改的位置更新至少每15分钟唤醒一次系统和您的应用程序,即使没有发生位置更改也是如此。

But it doesn't work as described... 但是它不能像描述的那样工作...

In my Xamarin.iOS project I use 在我的Xamarin.iOS项目中

_locationManager = new CLLocationManager
{
    PausesLocationUpdatesAutomatically = false,
};
_locationManager.StartMonitoringSignificantLocationChanges();

*I've skipped all permissions checks here and plist config. *我已跳过此处和plist配置的所有权限检查。 Updates work fine, the app receives updates, but only in case of real movement, not every 15 mins: it can take hours if a device is not moved. 更新工作正常,应用程序会收到更新,但仅在实际移动的情况下,而不是每15分钟更新一次:如果不移动设备,则可能需要几个小时。

I've also saw this question and answer with NSTimer , but I need these updates even when the app is terminated or backgrounded. 我也看到了NSTimer的问答 ,但即使应用终止或后台运行,我也需要这些更新。

According to a reply by an Apple staff member to this thread on the Apple developer forums , there may be a discrepancy between the documentation and what you, the original poster on that thread, and I myself are observing (ie that in contrast to what's documented, there may not be updates every 15 minutes). 根据苹果工作人员在苹果开发者论坛上对该线程 的答复 ,文档与您,该线程的原始海报以及我本人正在观察的内容之间可能存在差异(即与所记录的内容相反) ,可能每15分钟没有更新)。

Note the phrasing in the documentation: “every 15 minutes, at minimum”. 请注意文档中的措辞:“至少每15分钟”。 We all seem to have interpreted that “minimum” as the minimum frequency (ie once per 15 minutes, or twice per 15 minutes, or more). 我们所有人似乎都将“最小”解释为最小频率(即每15分钟一次,或每15分钟两次,或更多)。 But it could also be read as the minimum time interval (ie every 15 minutes, or every 30 minutes or more). 但是也可以将其读取为最小时间间隔(即每15分钟,或者每30分钟或更长时间)。 It doesn't give a guarantee of how frequent, but rather sets an expectation of how infrequent the updates will be. 它不能保证多久更新一次,而可以期望更新的频率很少 The documentation isn't wrong, but certainly open to multiple interpretations. 该文档没有错,但是肯定可以有多种解释。

What's important is what the Apple staff member states in their reply: 重要的是Apple员工在回复中指出的内容:

[…] simply using [significant location change] does not guarantee that your app will be resumed as [sic] some periodic rate. [...]简单地使用[显著位置变化]并不能保证你的应用程序将恢复为[原文]一些周期性的速度。

PS. PS。 For those who can do something about the documentation: rdar://30345408 (not mine) 对于那些可以对文档做些事情的人:rdar:// 30345408(不是我的)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 StartUpdatingLocation与重要更改位置服务 - StartUpdatingLocation Vs significant-change location service 带有UIBackgroundMode位置键的应用与使用重大更改位置服务的应用之间有什么区别? - What is the difference between an app with a UIBackgroundMode key of location and an app that uses the significant-change location service? iOS标准位置服务与重要变更位置服务与区域监控 - iOS standard location service vs significant-change location service vs region monitoring 如何确定iOS设备是否具有蜂窝功能来启动重大更改位置服务? - How to determine iOS device has cellular capability to start significant-change location service or not? 与startMonitoringForRegion相比,注册重大变更位置:desiredAccuracy: - Registering for significant-change location versus startMonitoringForRegion:desiredAccuracy: 15分钟后,后台位置更新在ios中不起作用? - After 15 mins Background Location update is not working in ios? 重要的位置变化至少每15分钟不会触发 - significant location change does not trigger at least every 15min Swift 中的显着变化定位服务与标准定位服务 - Significant-Change Location Service vs. Standard Location Service in Swift 重大更改位置服务将使用Wi-Fi还是移动数据? - Significant-Change Location Service will use Wi-Fi or Mobile Data? iOS重大位置更改和didUpdateLocations - iOS Significant Location Change and didUpdateLocations
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM