程序在后台运行时的通知 iOS 4

发布于 2024-09-10 01:44:37 字数 265 浏览 2 评论 0原文

我们正在寻找一种让 iPhone 应用程序超时的方法,并尝试了几种方法:

NSTimer 在操作后重置 操作后重置的 LocalNotification

两者都很接近,但都存在独特的问题:

NSTimer:当手机休眠时,计时器不会触发 LocalNotification:当应用程序在后台时,会显示通知,我们没有办法让应用程序必须接收通知。

询问小组这听起来是否正确,或者上面是否有我遗漏的某些点可以让这个工作发挥作用。

提前致谢!

We are looking for a way to timeout an iPhone application, and have tried several methods:

NSTimer that resets after an action
LocalNotification that resets after an action

Both are close, but suffer from unique issues:

NSTimer: When the phone sleeps, the timer will not fire
LocalNotification: When the app is in the background, the notification is displayed, we don't have a way to have the application have to receive the notification.

Asking the group if this sounds correct, or if there is maybe some point above that I am missing that would allow this to work.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

天生の放荡 2024-09-17 01:44:37

您确实意识到,当您的应用程序处于挂起状态时,您将不会收到任何通知 - 这在文档中是正确的。只有 3 类应用程序可以接收通知:音频应用程序(如 iPod 和类似产品)、基于位置的应用程序和 VoIP 应用程序。如果您的应用程序是这些应用程序之一,则必须正确设置您的 plist。

You do realize that when your app is in a suspended state, you won't receive any notifications -- and this is right in the documentation. There are only 3 classes of applications that can receive notifications: Audio applications (like iPod and analogues), location based applications, and voip apps. Your plist has to be set up correctly if your app is one of those applications.

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