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

Configure notification categories

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

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…

Contents