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.
Dynamic notification content
From the course: iOS and watchOS App Development: Notifications
Dynamic notification content
- [Instructor] While we've made a static content, you may need a more flexible dynamic case. You've used UN mutable notification content to configure the notification content. There is also UN notification content, which stores the notification content of a scheduled or delivered notification that we'll talk about later. It is read-only. You only set properties of UN mutable notification content objects. If you want to change your content into notification you cannot change the content directly but must make a new request with new content. To streamline my code for both initial and change notifications, I often make a template function for default content for my application. So let's make a new function and we'll stick it just below make pizza here, called notification content. And I'm going to give it a title for parameter, which will be a string. And I'm going to give it the body, so I have the two things I usually need, and make that a string as well. And that will return a UN…
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
-
-
-
-
(Locked)
Steps for local notifications1m 30s
-
(Locked)
Static notification content2m 18s
-
(Locked)
Dynamic notification content3m 44s
-
(Locked)
Time interval triggers2m 18s
-
Calendar notification triggers4m 26s
-
(Locked)
Notification requests5m 5s
-
(Locked)
Notification testing2m 2s
-
(Locked)
In-app notification4m 32s
-
(Locked)
-
-
-
-
-
-
-
-
-