问题描述
我们正在寻找一种方式来超时iPhone应用程序,并尝试了好几种方法:
We are looking for a way to timeout an iPhone application, and have tried several methods:
这一个动作后复位的NSTimer
LocalNotification,一个动作之后重置
NSTimer that resets after an actionLocalNotification that resets after an action
两者比较接近,但是从独特的问题的影响:
Both are close, but suffer from unique issues:
的NSTimer:当手机睡觉,定时器将不火
LocalNotification:当应用程序在后台运行,显示通知,我们没有办法让应用程序有接收通知
NSTimer: When the phone sleeps, the timer will not fireLocalNotification: 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.
在此先感谢!
推荐答案
您知不知道,当你的应用程序是处于暂停状态,您将不会收到任何通知 - 这是文件的权利,只有目前只有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.
这篇关于当程序在后台iOS 4的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!