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

Text response requests

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

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…

Contents