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.

Actions

Actions

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

Actions

- [Narrator] So far you've added a title, a subtitle, and body text. You've changed the badge to read 42. You can launch the app. Next, you need actions. Let's go back to Xcode and take a look at the APNS payload again. The beauty of the user notification frameworks is actions with push notifications work almost the same as a local notification. You set a category in the content. This time in the payload. You'll just add one more key, appropriately the category key to the aps dictionary. So I'm just going to comma, and I'll put quote here, and we put in category. And then after category, since we already have a whole set of categories set up from the local notifications, I'm going to use one of those. You can of course set up another category to handle it. But I'm just going to use our good old friend, the snooze category. And with that, I'm going to copy. And then paste my payload back into the tester. And go ahead and test it on my phone. And this time I'm going to use a live phone…

Contents