gpt4 book ai didi

ios - ios 7 中的重大位置更改事件 - 后台服务调用

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:29:51 25 4
gpt4 key购买 nike

我在我的应用程序中使用重要位置服务。如果我的应用程序被系统杀死或被用户强行关闭,使用重要位置更改服务事件我将位置数据发送到我的服务器,在 iOS 6 中。在 iOS6 中,我的应用程序也会在强制关闭后将数据发送到服务器。但是在 iOS 7 中,我没有收到这个重要的位置更改事件。

最佳答案

由于 iOS 7 SDK 不再处于 NDA 之下,为了完整起见,我将答案发布在这里。如此处的答案所述:Monitoring regions but location icon disappears when app is killed 如果用户在应用程序切换器中终止了应用程序,iOS 7 不允许在后台进行重大位置更改

有关 Apple forums 的更多信息,其中还包含 Apple 代表的以下回复:

If a user swipes up in the app switcher then the OS will not launch the app unless explicitly told to do so by the user. So no, SLC will not be launching the app, nor will silent notifications. The only thing that will launch the app at that point is the user tapping the icon. The intention here is that the user has expressed their choice of not having that app running any more for any reason, so we honor that. In this situation, there's really nothing that you can do. The next time the user launches the app you can let them know that some of the data may be missing, although you really cannot tell whether there's missing data or not (i.e. you might have been killed by the OS in the background and the user may not have moved thereby not triggering any SLC notifications). My suggestion would be to gather the data you can within the policies of the OS and if the user has manually killed the app then respect that wish and don't do anything. By all means, feel free to file a bug report if this change in behavior winds up causing problems for you or (especially) confusion for your users.

关于ios - ios 7 中的重大位置更改事件 - 后台服务调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18639976/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com