2

I have a task to create an alarm app. I manage to make the alarm sound using Local Notification.

The problem is that I can't make buttons(actions) on the local notification for "Snooze" and "Okay". I also searched how to implement Interactive Local Notification but I can't follow it. What I'm thinking now is to create an alertView with buttons instead of Local Notification in sounding the alarm. Is there a fireDate function in alertView than I can use to make it happen?

Gil Sand
  • 5,802
  • 5
  • 36
  • 78
Jongers
  • 595
  • 1
  • 9
  • 29

3 Answers3

4

No alertview itself dsnt have any firedata property But you went the right direction as when you want UIInteractive Notification to make a interactive notificaiton without the application being opened.

Here is a link to a much easier Objective C tutorial for Interactive Notifications.

Saheb Roy
  • 5,899
  • 3
  • 23
  • 35
  • Thank you for your advice and the link for the tutorial. How do I add the category to the payload? "aps" : { "alert" : "Pull down to interact.", "category" : "ACTIONABLE" } – Jongers Sep 03 '15 at 08:02
  • Just a quick note here, note that UIAlertView is deprecated and UIAlertController should be used instead. – Gil Sand Sep 03 '15 at 08:04
2

UIAlertView is only used for displaying alerts while the user is using the app. The alert view that's displayed to a user (or, more likely, a banner), is presented by the operating system. You can follow this tutorial on how to create local notifications with actions. Good luck!

Rony Rozen
  • 3,957
  • 4
  • 24
  • 46
  • Just a quick note here, note that UIAlertView is deprecated and UIAlertController should be used instead. – Gil Sand Sep 03 '15 at 08:04
2

for "How to Implement iOS8 Interactive Notification" you can check this, link

Here all the steps are mentioned you want to make local notifications...

Community
  • 1
  • 1
Shahzaib Maqbool
  • 1,479
  • 16
  • 25