From the course: iOS and watchOS App Development: Notifications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The notification extensions

The notification extensions

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

The notification extensions

- [Instructor] You might be wondering something about the last chapter, and user info. We were able to present the user info in the local snooze notification, but not in the push notification. How do you present the user info in a pushed notification? How do you add a photo to a push notification if you have a 4K maximum payload? How do developers add or enhance content to do that? An advanced feature of the user notification framework is the extensions. There's two extensions you should know about, the Service Extension and the Content Extension. The Service Extension intercepts payloads for APNs, and gives you the chance to change content in the notification before it is presented. In the Service Extension, you can modify your content with a UNMutableNotificationContent object and get the same results you've seen with the local notification on snooze. That's how we'll get the user info in the push notification. The Content Extension gives you a storyboard to design your…

Contents