Snooze local Notification

醉酒当歌 提交于 2019-12-03 13:06:15

问题


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.

But is there another way to do this?


回答1:


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.

What about that?


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.




回答2:


Read This articles:

  1. About Local Notifications and Push Notifications
  2. Local Notification Sample Code (OS 4.0 only)
  3. Repeating an iOS local notification
  4. Local Notifications
  5. iPhone Tutorial: Scheduling Local Notifications using a Singleton class

I think you can user Local Notifications for your alarm application ...



来源:https://stackoverflow.com/questions/6197840/snooze-local-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!