暂停本地通知 [英] Snooze local Notification
问题描述
我正在处理警报应用程序,我正在使用本地通知。现在我想在闹钟中添加贪睡功能。我在Google上搜索过,发现iPhone不支持这种功能。
I am working on an alarm application and I am using local notification for that. Now I want to add snooze functionality to my alarm. I searched on Google and found that iPhone doesn't support such functionality.
但还有其他办法吗?
推荐答案
AFAIK在弹出通知窗口时无法添加自定义行为。
BUT ...
您可以这样尝试:
用户点击查看后,应用程序由UILocalNotification启动,
您可以打开模态视图一个巨大的按钮Snooze和另一个(较小的)Open。
如果用户点击Snooze,你只需安排另一个本地通知并关闭应用程序。
AFAIK you can't add a custom behaviour when the notification windows pops up. BUT... You can try it like this: after the user has clicked "View" and the app is launched by an UILocalNotification, you could open a modal view with a huge button "Snooze" and another (smaller) one "Open". And if the user taps "Snooze" you just schedule another local notification and close the app.
那是怎么回事?
PS:几天前我第一次使用这些本地通知工作。
我必须设计一个可以普遍使用的课程。
实现贪睡的方法很酷!
如果我得到更好的解决方案,我会再次给你写信。
但请告诉我(和其他)在这个论坛,如果你找到了一个很好的解决方案。
PS: A couple of days ago I've worked the first time with these local notifications. I had to design a class which can be used universally. A method for implementing snooze would be cool! I'll write you again, if I get a better solution. But please tell me (and other) in this forum, If you have found a good solution.
这篇关于暂停本地通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!