init(kind:destination:title:body:image:actions:timestamp:appBadgeCount:isMutable:options:)
Initialize a new Declarative Push Notification.
init(kind: PushMessage.NotificationKind = .declarative, destination: URL, title: String, body: String? = nil, image: URL? = nil, actions: [PushMessage.NotificationAction] = [], timestamp: Date? = .now, appBadgeCount: Int? = nil, isMutable: Bool = false, options: PushMessage.NotificationOptions = PushMessage.NotificationOptions())
Parameters
- kind
The kind of notification to send. Defaults to
declarative
.- destination
The destination URL that should be opened when the user interacts with the notification.
- title
The notification’s title text.
- body
The notification’s body text. Defaults to
nil
.- image
A URL for the image to display in a notification. Defaults to
nil
.- actions
A list of actions to display alongside the notification. Defaults to an empty array.
- timestamp
The timestamp to attach to the notification. Defaults to
.now
.- data
Optional data to associate with the notification for when a service worker is used. Defaults to
nil
.- appBadge
The badge numeral to use for a PWA’s app icon. Defaults to
nil
.- isMutable
A preference indicating the notification should first be processed by a service worker. Defaults to
false
.- options
Notification options to use for additional configuration. See
NotificationOptions
.