encode(to:)
VAPIDConfiguration.swift:194func encode(to encoder: any Encoder) throws
func encode(to encoder: any Encoder) throws
s7WebPush5VAPIDO13ConfigurationV6encode2toys7Encoder_p_tKF
What are these?7L4Y7
import WebPush
struct Configuration
A configuration object specifying the contact information along with the keys that your application server identifies itself with.
enum VAPID
A set of types for Voluntary Application Server Identification, also known as VAPID.
protocol Encoder
A type that can encode values into a native format for external representation.
init(from decoder: any Decoder) throws
init(key: Key, deprecatedKeys: Set<Key>? = nil, contactInformation: ContactInformation, expirationDuration: Duration = .hours(22), validityDuration: Duration = .hours(20))
Initialize a configuration with a single primary key.
init(primaryKey: Key?, keys: Set<Key>, deprecatedKeys: Set<Key>? = nil, contactInformation: ContactInformation, expirationDuration: Duration = .hours(22), validityDuration: Duration = .hours(20)) throws(ConfigurationError)
Initialize a configuration with a multiple VAPID keys.
var contactInformation: ContactInformation
The contact information an administrator of a push service may use to contact you in the case of an issue.
var deprecatedKeys: Set<Key>? { get }
The set of deprecated keys to continue to support when signing push messages, but shouldn’t be used for new registrations.
var expirationDuration: Duration
The number of seconds before a cached authentication header signed by this configuration fully expires.
var keys: Set<Key> { get }
The set of valid keys to choose from when identifying the applications erver to new registrations.
var primaryKey: Key? { get }
The VAPID key that identifies the push service to subscribers.
var validityDuration: Duration
The number of seconds before a cached authentication header signed by this configuration is renewed.
mutating func updateKeys(primaryKey: Key?, keys: Set<Key>, deprecatedKeys: Set<Key>? = nil) throws(ConfigurationError)
Update the keys that this configuration represents.
enum CodingKeys
The coding keys used to encode a VAPID configuration.
enum ContactInformation
The contact information for the push service.
struct Duration
A duration in seconds used to express when VAPID tokens will expire.
enum KeyStatus
The satus of a key as it relates to a configuration.