Push-Definitions/Sources/PushAPI/DeviceAuthentication.swift

33 lines
884 B
Swift
Raw Normal View History

2022-06-05 11:47:58 +02:00
import Foundation
/**
An object to store the necessary information to authenticate a device to the server.
*/
2022-06-05 12:10:38 +02:00
public struct DeviceAuthentication: Codable {
2022-06-05 11:47:58 +02:00
/**
The push token of the device.
The token is used to uniquely identify the device.
*/
2022-06-05 12:13:47 +02:00
public let pushToken: PushToken
2022-06-05 11:47:58 +02:00
/**
The authentication token of the device.
This token is created by the server during device registration, and used for all subsequent requests.
*/
2022-06-05 12:13:47 +02:00
public let authentication: AuthenticationToken
2022-06-05 11:47:58 +02:00
2022-06-05 18:25:39 +02:00
/**
Create a device authentication object.
- Parameter pushToken: The APNs device token
- Parameter authentication: The authentication token generated by the server
*/
public init(pushToken: PushToken, authentication: AuthenticationToken) {
self.pushToken = pushToken
self.authentication = authentication
}
2022-06-05 11:47:58 +02:00
}