KeyStatus
The satus of a key as it relates to a configuration.
enum KeyStatus
The satus of a key as it relates to a configuration.
enum KeyStatus
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.
nonisolated func keyStatus(for keyID: VAPID.Key.ID) -> VAPID.Configuration.KeyStatus
Check the status of a key against the current configuration.
case valid
The key is valid and should continue to be used.
case deprecated
The key had been deprecated.
case unknown
The key is unknown to the configuration.
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.
func encode(to encoder: any Encoder) throws
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.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.