安排应用程序在特定日期/时间启动/进入前台

发布于 2025-01-08 09:04:39 字数 330 浏览 4 评论 0原文

我希望有多个时间表让我的应用程序启动(如果可能)或在特定日期/时间从暂停状态进入前台。它是一种闹钟,但是我需要的不仅仅是能够像该线程所建议的那样显示通知。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜深人未静 2025-01-15 09:04:39

不可以,应用程序只能通过以下方式启动或进入前台以响应用户干预:

  1. 用户点击您的应用程序图标
  2. 用户打开您的应用程序以响应通知
  3. 用户打开 URL(从链接或以编程方式从另一个应用程序) )打开您的应用程序

No, an app can launch or enter the foreground only in response to user intervention, in the following ways:

  1. User taps your app icon
  2. User opens your app in response to a notification
  3. User opens an URL (from a link, or programatically from another app) that opens your app
绅刃 2025-01-15 09:04:39

你所描述的情况是无法做到的。应用程序可以在后台模式下执行一些任务,例如电话应用程序和音频应用程序。正如您已经提到的,本地通知。

不确定这是否有帮助,但您可以注册您的应用程序来处理自定义 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文