options
Additional options and configuration for a notification.
var options: NotificationOptions
Defaults to an empty NotificationOptions
configuration of options.
Additional options and configuration for a notification.
var options: NotificationOptions
s7WebPush0B7MessageO12NotificationV7optionsAC0D7OptionsVvp
What are these?7ZH0T
Defaults to an empty NotificationOptions
configuration of options.
import WebPush
struct Notification<Contents> where Contents : Encodable, Contents : Sendable
A Declarative Push Notification.
enum PushMessage
Common Push Message types.
struct NotificationOptions
Additional options and configuration to use when presenting a notification.
init(kind: NotificationKind = .declarative, destination: URL, title: String, body: String? = nil, image: URL? = nil, actions: [NotificationAction] = [], timestamp: Date? = .now, data: Contents?, appBadgeCount: Int? = nil, isMutable: Bool = false, options: NotificationOptions = NotificationOptions())
Initialize a new Declarative Push Notification.
var actions: [NotificationAction]
The actions available on the notification for a user to interact with.
var appBadgeCount: Int?
The badge count to display on a PWA’s app icon.
var body: String?
The notification’s body text.
var data: Contents?
Optional data to associate with a notification for when a service worker processes it.
var destination: URL
The destination URL that should be opened when the user interacts with the notification.
var image: URL?
The image to be displayed in the notification.
var isMutable: Bool
A preference indicating if a notification can be mutated by a service worker running on the subscriber’s device.
var kind: NotificationKind
The kind of notification to deliver.
var timestamp: Date?
The date and time that should be attached to a notification.
var title: String
The notification’s title.