Push-Definitions/Sources/PushMessageDefinitions/DeviceRegistration.swift

33 lines
965 B
Swift
Raw Normal View History

2022-06-05 11:47:58 +02:00
import Foundation
/**
An object containing the information required to issue a registration request to the server.
*/
2022-06-05 12:10:38 +02:00
public struct DeviceRegistration: Codable {
2022-06-05 11:47:58 +02:00
/// The push token of the registering device
2022-06-05 12:13:47 +02:00
public let pushToken: PushToken
2022-06-05 11:47:58 +02:00
/// The application id for which the device wants to register
2022-06-05 12:13:47 +02:00
public let application: ApplicationId
2022-06-05 11:47:58 +02:00
/**
A custom name for the device.
The name is displayed when registered users request a list of all devices in an application.
*/
2022-06-05 12:13:47 +02:00
public let name: String
2022-06-05 18:25:39 +02:00
/**
Create a new device registration object.
- Parameter pushToken: The push token to register
- Parameter application: The application the device uses
- Parameter name: A descriptive name of the device.
*/
public init(pushToken: PushToken, application: ApplicationId, name: String) {
self.pushToken = pushToken
self.application = application
self.name = name
}
2022-06-05 11:47:58 +02:00
}