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.

Steps for local notifications

Steps for local notifications

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

Steps for local notifications

- [Instructor] With permissions set up, we'll explore local notifications first. These notifications come from your app, calendar events, locations, timers, and other events are easily made into notifications. Before we build a notification, I want to show you the four parts of a local notification. Stop the app and head to the introNotificiation method at the bottom of ViewController. There are four parts to a notification. First of all, there's the content. This is usually text, but can be more. We'll discuss some of these other forms of content later. Second, is the trigger. This is the condition that will launch the notification. There are three triggers for local notifications, time intervals, date components, and location. Thirdly, we'll take the trigger and the content, and make a request. Finally, we'll schedule the request by adding it to the notification center. Once scheduled, it is no longer in the app, but handled by the notification center, which is a background task…

Contents