Learn how to run a notification from different schemes in the simulator and how to run with iPhone push notifications in the simulator.
- [Instructor] There's one more scheme in the simulator we haven't tried yet. It's the scheme with the red icon and the word notification in parentheses. Select this one and then run. This does not show the local notification from the phone. This is showing a remote or push notification. Push notifications come from an outside server which deliver an external payload. You can learn more about push notifications in the course iOS App Development Notifications. But I wanted to show you how to set up Xcode to quickly test remote notifications in the launch.
Dismiss the notification. In the supporting files folder in the watch kit extension is a file push notification payload apns. This is the json file Xcode uses to simulate a notification. Change the body and title strings of the alert. Change the body to Push Pizza and the title to Huli Pizza. Under the watch kit simulator actions, change the title and identifier.
Change the first button to snooze and identifier to snooze action. Stop the simulator. Run again and you'll find the payload shows up in the notification. Remote or push notifications are beyond the scope of this course. I'll touch on them a little later. But for most of the rest of this course we'll be sticking to local notifications.
- Running iPhone local notifications on the Apple Watch simulator
- Running push notifications on the Apple Watch simulator
- Adding icons
- Default long look, static long look, and dynamic long look
- Setting up local notifications
- Coding and running notifications
- Setting interface controllers