Initializermochidev.swift-webpush 0.4.2WebPush
init(from:)
init(from decoder: any Decoder) throws
init(from decoder: any Decoder) throws
import WebPush
struct Subscriber
A default subscriber implementation that can be used to decode subscriptions encoded by client-side JavaScript directly.
protocol Decoder
A type that can decode values from a native format into in-memory representations.
init(_ subscriber: some SubscriberProtocol)
Cast an object that conforms to SubscriberProtocol
to a Subscriber
.
init(endpoint: URL, userAgentKeyMaterial: UserAgentKeyMaterial, vapidKeyID: VAPID.Key.ID)
Initialize a new subscriber manually.
var endpoint: URL
The push endpoint associated with the push subscription.
var id: String { get }
A safe identifier to use for the subscriber without exposing key material.
var userAgentKeyMaterial: UserAgentKeyMaterial
The key material provided by the user agent to encrupt push data with.
var vapidKeyID: VAPID.Key.ID
The VAPID Key ID used to register the subscription, that identifies the application server with the push service.
enum CodingKeys
The encoded representation of a subscriber.
protocol SubscriberProtocol : Sendable
Represents a subscriber registration from the browser.