开发者

How to retain access to the UILocalNotification if the event message was initially ignored

I have a UILocalNotification that fires on a recurring schedule. The purpose that the notification fulfills is to just simply remind the user to do something. When the notification fires, they can enter into the app and another alert pops up and asks them if they complete the task, and the app tracks accordingly.

If the user is using their phone, the notification fires, and the app switches great, and the user input is recorded. If they are using the app at the time the notification fires, everything works great. If they aren't using their phone, the notification wakes the phone up, and has an option to "Slide to view" whereupon the app comes up and the alert pops up great and the input is recorded.

The problem is when the user isn't using their phone, and the user DOESN'T slide to view during the few second window that the alert wakes up the phone, when the user wakes up the device later on, the alert window is sti开发者_开发问答ll there, letting the user know that something happened, but the "Slide to view" option is replaced with the standard "Slide to unlock" and when the phone is unlocked, the ability to go into the app is gone, and the user input can't be recorded.

So I am losing access to the ability to respond to a notification in my app. Is there anything that can be done to solve this problem? Thanks!


Only way to do that is to keep track on notification outside notification system. Unfortunately notification system is not allowing you to read any data about notifications you set.

Whenever you set a notification add it to a list of notifications with a date when it will be launched. When user enters your application go through your local list and see which notification expired (date < NOW).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜