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.
Respond to action requests
From the course: iOS and watchOS App Development: Notifications
Respond to action requests
- [Instructor] So we've got action buttons now, but they don't do anything, I can just hit them, and they just disappear, don't do anything. There's two more steps you'll need to do in order to get them to do something. First, we're going to set up another delegate method, and secondly add some code for that action. I'm going to start with the delegate. So head over to the notification center delegate, close up the app, and we're going to go to NotificationCenterDelegate.swift, and we're going to add another method to our code. So I'll put it right under the one I got already. Give myself some space, and this one's going to be userNotificationCenter, and you see the first one there is one we already have, the second one asks the delegate to process the user's response to a delivery notification, again it's hard to see this on the screen, so I'm going to go by that message on the top here to tell me which one it is. And so you get this one, which is more likely known as user…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Get interactive with notifications1m 39s
-
(Locked)
Configure notification categories3m 47s
-
(Locked)
Add categories to notifications2m 19s
-
(Locked)
Add actions to categories4m 37s
-
(Locked)
Respond to action requests4m 13s
-
Code the action response2m 32s
-
(Locked)
Code the next action response4m 17s
-
(Locked)
Test actions1m 47s
-
(Locked)
Text response actions2m 50s
-
(Locked)
Text response requests4m 13s
-
(Locked)
-
-
-
-
-
-
-