From the course: iOS and watchOS App Development: Notifications
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Alerts
- [Narrator] The alert key we just looked at was a string. Alerts can also use a dictionary describing the content of the alert that shows on your device. They use keywords the way we used properties in local notifications. Let's go back to Xcode and look at our payload in here. And we're going to change the alert. We're taking here, I'm going to delete this. Going to put some braces in there. And then inside these braces, I'm going to start with the title. Huli Pizza Company, comma. Then we're going to put the body of the text. You are going to love this. And I'll add a subtitle. And these all should look kind of familiar, because they're the same properties we had for local notifications content. And then in the subtitle, we'll put your order is almost ready. Make sure your syntax is right, because this is very syntax sensitive. And so you've got all your commas, your parentheses, and your quotes in the right place. I'm going to go ahead and also change the badge number to 42, so…
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.