Configuring a category for our static interface controller
When working with notifications, each notification interface must be assigned a notification category that tells Apple Watch when to use it. If you remember, back in our PushNotificationPayload.apns
file, within the aps
dictionary object, we specified an ORDER_PLACED
category string value within the payload that Apple Watch uses to determine which notification scenes to display within your Interface.storyboard
file.
If Apple Watch determines that an incoming notification doesn't include a value for our category string, it will display the notification interface that is configured with the default category.
In this section, we will look at the steps involved in setting up a notification category for our notification interface controller:
Select the
Interface.storyboard
file from the project navigation window.Next, choose Static Notification Interface Controller and click on the Show Attributes Inspector button.
Next, click on the myCategory...