Module: Toybox.Notifications
Overview
Classes Under Namespace
Classes: NotificationMessage
Constant Summary
-
NotificationMessageType
Notification message types
Name | Value | Since | Description | See Also |
---|---|---|---|---|
NOTIFICATION_MESSAGE_TYPE_DISMISSED | 1 | API Level 5.1.0 |
The notification was dismissed by the user |
|
NOTIFICATION_MESSAGE_TYPE_SELECTED | 2 | API Level 5.1.0 |
The notification action was selected by the user |
Typedef Summary collapse
-
Action as { :label as Lang.String, :data as Notifications.NotificationDataType }
A notification action.
-
NotificationDataType as Application.PropertyKeyType or Lang.Array<Application.PropertyKeyType> or Lang.Dictionary<Application.PropertyKeyType, Notifications.NotificationDataType>
-
NotificationMessageCallback as Lang.Method(message as Notifications.NotificationMessage) as Void
-
ShowNotificationOptions as { :icon as WatchUi.BitmapResource or Graphics.BitmapReference or Lang.ResourceId, :body as Lang.String or Lang.ResourceId, :data as Notifications.NotificationDataType, :actions as Lang.Array<Notifications.Action>, :dismissPrevious as Lang.Boolean }
Notification options.
Instance Method Summary collapse
-
registerForNotificationMessages(callback as Notifications.NotificationMessageCallback or Null) as Void
Register a callback for receiving notification messages.
-
showNotification(title as Lang.String or Lang.ResourceId, subTitle as Lang.String or Lang.ResourceId, options as Notifications.ShowNotificationOptions or Null) as Void
Push a notification to the display.
Typedef Details
Action as { :label as Lang.String, :data as Notifications.NotificationDataType }
A notification action
NotificationDataType as Application.PropertyKeyType or Lang.Array<Application.PropertyKeyType> or Lang.Dictionary<Application.PropertyKeyType, Notifications.NotificationDataType>
NotificationMessageCallback as Lang.Method(message as Notifications.NotificationMessage) as Void
ShowNotificationOptions as { :icon as WatchUi.BitmapResource or Graphics.BitmapReference or Lang.ResourceId, :body as Lang.String or Lang.ResourceId, :data as Notifications.NotificationDataType, :actions as Lang.Array<Notifications.Action>, :dismissPrevious as Lang.Boolean }
Notification options
Instance Method Details
registerForNotificationMessages(callback as Notifications.NotificationMessageCallback or Null) as Void
Register a callback for receiving notification messages.
The callback will be called once for each notification message. If there are messages queued for the app when this function is called, the callback will immediately be called once for each pending message.
showNotification(title as Lang.String or Lang.ResourceId, subTitle as Lang.String or Lang.ResourceId, options as Notifications.ShowNotificationOptions or Null) as Void
Push a notification to the display