Displaying messages within the notification interface
In our last section, we modified the view controller class for our iOS app so that it could set up and schedule a notification message once the order is successfully processed; it could then display the receipt information associated for the chosen product within our Apple Watch notification controller.
In this section, we need to create the necessary code that will be responsible for displaying the notification information within our dynamic interface controller. Take a look at the following steps:
Open the
NotificationController.swift
file located within the ShoppingList WatchKit Extension group in the project navigation window.Next, locate the
didReceiveLocalNotification
method and replace it with the following code snippet:override func didReceiveLocalNotification(localNotification: UILocalNotification, withCompletion completionHandler: ((WKUserNotificationInterfaceType) -> Void)) { // This method is called when a local notification...