Deliver quietly (iOS 12 feature)

Open AppDelegate. In the checkNotifications() method, you currently have three options: .alert, .sound, and .badge. Update these options by adding .provisional. When you are done, you should have the following:

func checkNotifications() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge, .provisional]) { (isGranted, error) in
if isGranted {
print("Notifications permissions granted.")
} else {
print("Notifications permissions denied.")
}
}
}

For this to work, we need to delete the app and re-run it. This time, when you rerun it, you will notice that the user is no longer promoted to use notifications. Proceed to a restaurant detail, and this time when you tap the time in the detail, you will notice that you no longer get notifications.

If you leave the app and go to the Notification Center (swipe down from the upper left corner of the phone), you will see the notification there instead:

Deliver quietly is a great feature if you want to get your users using notifications by getting them to show up in the Notification Center by default. There, the user can customize these notifications themselves in the settings. We are done with this feature, so delete the app and remove the .provisional from the request, as we will be moving forward along the normal route. Rerun your app and you should see the notification permission message again:

The next feature I want to look at is embedding images into your notifications. This feature was introduced in iOS 10. Before we can embed an image, we need a test image. In the Misc folder of the Navigator panel, create a new group, called Images. Then, in the project folder for this book, open the asset folder for this chapter and drag the image assets into the Images folder that we just created.