安排应用程序在特定日期/时间启动/进入前台
我希望有多个时间表让我的应用程序启动(如果可能)或在特定日期/时间从暂停状态进入前台。它是一种闹钟,但是我需要的不仅仅是能够像该线程所建议的那样显示通知。
iPhone iOS 4 - 日程应用在特定时间和日期运行功能
有没有办法实现这一点,而不需要始终让应用程序在前台运行?
我已经开始阅读 GCD 和 NS 操作,但不确定两者是否适用。
I would like to have multiple schedules for my app to launch (if possible) or to enter foreground from a suspended state at specific dates / times. It is a type of alarm clock, however I require more than being able to show a notification as this thread suggests.
iPhone iOS 4 - schedule app to run functions at specific times and days
Is there a way to achieve this, without having the app in the foreground all the time?
I have started reading up on GCD and NS Operations, but not sure whether either will even be applicable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可以,应用程序只能通过以下方式启动或进入前台以响应用户干预:
No, an app can launch or enter the foreground only in response to user intervention, in the following ways:
你所描述的情况是无法做到的。应用程序可以在后台模式下执行一些任务,例如电话应用程序和音频应用程序。正如您已经提到的,本地通知。
不确定这是否有帮助,但您可以注册您的应用程序来处理自定义 URL 方案。用户可以单击电子邮件或网页中特制的 URL 来打开您的应用程序。
What you describe cannot be done. There are a few tasks that apps are allowed to do while in background mode, such as telephony apps and audio apps. And as you already mentioned, local notifications.
Not sure if this might help, but you can register your app to handle a custom URL scheme. The user could click a specially-crafted URL in an email or web page to open your app.