convenience init(vapidConfiguration: VAPID.Configuration, networkConfiguration: NetworkConfiguration = .default, backgroundActivityLogger: Logger? = .defaultWebPushPrintLogger, eventLoopGroupProvider: NIOEventLoopGroupProvider = .shared(.singletonMultiThreadedEventLoopGroup))
Initialize a manager with a VAPID configuration.
init(vapidConfiguration: VAPID.Configuration, networkConfiguration: NetworkConfiguration = .default, backgroundActivityLogger: Logger, executor: Executor, skipClientShutdown: Bool = false)
Internal method to install a different executor for mocking.
func send(data message: some DataProtocol, to subscriber: some SubscriberProtocol, deduplicationTopic topic: Topic? = nil, expiration: Expiration = .recommendedMaximum, urgency: Urgency = .high, logger: Logger? = nil) async throws
Send a push message as raw data.
func send(json message: some Encodable & Sendable, to subscriber: some SubscriberProtocol, deduplicationTopic topic: Topic? = nil, expiration: Expiration = .recommendedMaximum, urgency: Urgency = .high, logger: Logger? = nil) async throws
Send a push message as encoded JSON.
func send(json message: some Encodable & Sendable, to subscriber: some SubscriberProtocol, encodableDeduplicationTopic: some Encodable, expiration: Expiration = .recommendedMaximum, urgency: Urgency = .high, logger: Logger? = nil) async throws
Send a push message as encoded JSON.
func send<Contents>(notification: PushMessage.Notification<Contents>, to subscriber: some SubscriberProtocol, deduplicationTopic topic: Topic? = nil, expiration: Expiration = .recommendedMaximum, urgency: Urgency = .high, logger: Logger? = nil) async throws where Contents : Encodable, Contents : Sendable
Send a push notification.
func send<Contents>(notification: PushMessage.Notification<Contents>, to subscriber: some SubscriberProtocol, encodableDeduplicationTopic: some Encodable, expiration: Expiration = .recommendedMaximum, urgency: Urgency = .high, logger: Logger? = nil) async throws where Contents : Encodable, Contents : Sendable
Send a push notification.
func send(string message: some StringProtocol, to subscriber: some SubscriberProtocol, deduplicationTopic topic: Topic? = nil, expiration: Expiration = .recommendedMaximum, urgency: Urgency = .high, logger: Logger? = nil) async throws
Send a push message as a string.
func send(string message: some StringProtocol, to subscriber: some SubscriberProtocol, encodableDeduplicationTopic: some Encodable, expiration: Expiration = .recommendedMaximum, urgency: Urgency = .high, logger: Logger? = nil) async throws
Send a push message as a string.