From the course: iOS and watchOS App Development: Notifications
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Text response requests
From the course: iOS and watchOS App Development: Notifications
Text response requests
- [Narrator] We have set some inputs, but haven't done anything with it yet. You need to do this in the notification center delegate class, like the other responses. So go ahead and just close the app. And we're going to go over to the notifications center delegate and I'm going to get rid of this debug error to give myself some room. So, you'll see we have two methods that we added: the willPresent and the didReceive. I'm going to go to the top of the didReceive and like we did for the other actions here, set it up as an if clause to look for the action identifier. So, I'm going to do it right up top here, on top of the other ones. And I'm going to do if action equals text.input. Now there's a string property, usertext, that is the user's response in the UN text input notification response class. We'll need to recast the action response from its current UNNotification response to a UN text input notification response. So, first step of this will, of course, be to downcast it. So, I'm…
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
-
-
-
-
-
-
Get interactive with notifications1m 39s
-
Configure notification categories3m 47s
-
Add categories to notifications2m 19s
-
Add actions to categories4m 37s
-
Respond to action requests4m 13s
-
Code the action response2m 32s
-
Code the next action response4m 17s
-
Test actions1m 47s
-
Text response actions2m 50s
-
Text response requests4m 13s
-
-
-
-
-
-
-
-