This video demonstrates how to run a notification and shows the keystrokes to make a notification appear.
- [Narrator] We've put together enough code to run the application, however, there's a few things you need to know about notifications and where they show when one presents itself. As a default behavior, notifications only appear outside the application. Build and run the application. When the application comes up, tap the schedule a pizza button. Then press Command + Shift + H on the keyboard to click the home button on the phone. Wait a few seconds, and the notification appears. Click on the notification, and the app launches.
Next, click the make a pizza button. This time, lock the phone with a Command + L keyboard sequence. Wait for the notification. When it appears, use Command + Shift + H on the keyboard twice to open the phone. Since we didn't tap the notification, the notification will be in the notification center. Swipe down from the top of the app. You'll see the notification in the notification center. Swipe back up to go in to the app.
Tap make a pizza one more time, then press Command + L. Press Command + Shift + H, and you'll see a lock screen with the time on it. You can swipe and you'll see that there is a clear button, so if you want to dismiss those notification, you can dismiss it. There's several ways for notifications to appear outside the application. When you test your application, make sure you test it in all the places the notification can show up.
- The differences between local and remote notifications
- Adding code to a demo project to get permissions
- Adding code to run notifications if a user gives permission
- Extracting content from pending and delivered notifications
- Creating in-app notifications
- Updating and removing notifications
- Getting and using a string for a text response object
- Adding and executing an action
- Adding rich content to a notification