程序在后台运行时的通知 iOS 4
我们正在寻找一种让 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确实意识到,当您的应用程序处于挂起状态时,您将不会收到任何通知 - 这在文档中是正确的。只有 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.