Snooze local Notification

前端 未结 2 595
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 09:51

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 d

2条回答
  •  灰色年华
    2021-02-06 10:18

    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.

提交回复
热议问题