From the course: iOS and watchOS App Development: Notifications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Customize actions

Customize actions

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

Customize actions

- [Instructor] If you have the last notification still up, you'll notice we have that Snooze button still. If you press it, it still works. In the content extension, you can make your actions even more interactive. You can replace, add and remove actions. Let's add another action, a Like button and change the message on the Snooze action. So go ahead and stop the app and back in the code go ahead and go to the Notification Review Controller. And it did receive notification method we were looking at earlier. Above the code we have, I'm going to add a new action as constants for this class. And so we're going to do let likeAction equals UNnotificationAction. Even though we use the one with the identifier. The string for this one will be "like." The title will be "like." And the options will be empty. All right, I've got one of these, I'm going to just copy this. And make another one for the Snooze button again. And I'm just going to change over here we can change this to "snooze." And…

Contents