重大位置更改后,应用程序未使用位置键启动 [英] Application doesn't launch with location key after a significant location change

查看:60
本文介绍了重大位置更改后,应用程序未使用位置键启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在应用程序使用CLLocationManager类中的startMonitoringSignificantLocationChanges方法终止后,我的应用程序也使用核心位置.

My application uses the core location also after the application terminates with the method startMonitoringSignificantLocationChanges in CLLocationManager class.

我的应用程序使用以下方法在iOS 5和6中使用位置键启动:-(BOOL)应用程序:应用程序didFinishLaunchingWithOptions:launchOptions;在AppDelegate类中,一切正常.

My application launches with a location key in iOS 5 and 6 in the method: - (BOOL) application:application didFinishLaunchingWithOptions:launchOptions; in AppDelegate class and everything works well.

但是在iOS-7 Beta中,重大位置更改后,该应用程序没有使用位置键启动.

But in iOS-7 betas the application doesn't launch with a location key after a significant location change.

有人遇到过这个问题吗?

Has anybody encountered this problem?

我在模拟器和设备上进行了尝试.

I tried it on a simulator and in the device.

感谢您的帮助.

推荐答案

当应用程序被用户从应用程序切换器终止时,我的应用程序中存在相同的问题.但是,如果操作系统由于内存不足或其他原因而终止了它,它的确会使用位置键启动.

I have the same problem in my app, when the app was terminated by user from app switcher. But it does launch with location key if it was terminated by OS for low memory or other reason.

不幸的是,这是来自iOS7的预期结果.我从一位传道人那里得到了苹果的官方回应:

It is the expected result from iOS7 unfortunately. An official apple response I got from one of their evangelists:

如果用户在应用切换器中向上滑动,则操作系统将无法启动除非用户明确要求这样做.所以不,SLC将不会启动该应用程序,也不会发出静默通知.唯一的届时将启动应用程序的事情是用户点击图标.这里的意图是用户已经表达了他们的选择出于任何原因不再运行该应用程序,因此我们很荣幸那.在这种情况下,您实际上无能为力.这下次用户启动该应用时,您可以让他们知道数据可能会丢失,尽管您实际上无法确定是否是否存在数据丢失(即您可能已被操作系统杀死)在后台,用户可能没有移动,因此没有触发任何SLC通知).我的建议是聚集您可以在操作系统的策略内以及用户是否拥有的数据手动杀死该应用程序,然后尊重自己的意愿,不做任何事情.如果发生这种情况,请务必提交错误报告行为逐渐结束,给您造成问题或(尤其是)混乱为您的用户.

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.

附加到Apple DEV论坛的链接: https://devforums.apple.com/message/882691#882691

Attach link to Apple DEV forums: https://devforums.apple.com/message/882691#882691

这篇关于重大位置更改后,应用程序未使用位置键启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆