From the course: iOS and watchOS App Development: Notifications
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Configure notification categories
From the course: iOS and watchOS App Development: Notifications
Configure notification categories
- [Instructor] When using notification categories they must be one of the first objects loaded into the device from the app. The earlier you can the better. You will often use them in different places throughout the app, so it's best to load them in your App Delegate. If you have the app open from the last exercise, double click in the console area to clear all the notifications, and give us a clean slate. Go ahead and stop the app. Head over to the App Delegate if you're not already there, and at the top of the App Delegate we're going to add a new function. So right here under the let nc Delegate, and above did Finish Launching With Options, I'm going to add the func set Categories. And I'm going to add two categories, a pizza steps category, and a snooze category, one for each of our notifications. And I'm going to start with the pizza steps. I'm going to do let pizza steps Category equal UN Notification Category. And now you'll see there's four of them here, and three have actual…
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
-
-
-
-
-
-
-
-