watchOS by Tutorials by unknow

watchOS by Tutorials by unknow

Author:unknow
Language: eng
Format: epub
Publisher: Ray Wenderlich


Creating a custom notification

Now that you’ve done all the prep work, you get to build the Pawsome custom long look static and dynamic notification, which will look like this when you’re done:

Static notification

Open Interface.storyboard from the PawsomeWatch group and drag a notification interface controller from the Object Library onto the storyboard.

Your storyboard will now look like this:

In your storyboard, notification categories are shown as arrows, or entry points, which point to a notification scene. Since apps can have multiple notification types, categories are used to differentiate one notification scene from another.

Select the notification category for the notification scene you just created — that’s the arrow itself. Next, in the Attributes Inspector, set the notification category name to Pawsome, which is the same string you used earlier in PawsomeNotificationPayload.apns.

Note: Notification categories are typically registered in the app delegate of the containing iOS app, but can also be registered in the Watch app. If you’re curious, open AppDelegate.swift or InterfaceController.swift to learn how and where Pawsome configures the notification category.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.