CodingKeys
The coding keys used to encode a VAPID configuration.
enum CodingKeys
The coding keys used to encode a VAPID configuration.
enum CodingKeys
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.
case primaryKey
case keys
case deprecatedKeys
case contactInformation
case expirationDuration
case validityDuration
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 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.
protocol CodingKey : CustomDebugStringConvertible, CustomStringConvertible, Sendable
A type that can be used as a key for encoding and decoding.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
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
init?(intValue: Int)
init?(stringValue: String)
var debugDescription: String { get }
A textual representation of this key, suitable for debugging.
var description: String { get }
A textual representation of this key.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.