Push-Definitions/Sources/PushMessageDefinitions/DeviceRegistration.swift
2022-06-09 11:48:00 +02:00

33 lines
965 B
Swift

import Foundation
/**
An object containing the information required to issue a registration request to the server.
*/
public struct DeviceRegistration: Codable {
/// The push token of the registering device
public let pushToken: PushToken
/// The application id for which the device wants to register
public let application: ApplicationId
/**
A custom name for the device.
The name is displayed when registered users request a list of all devices in an application.
*/
public let name: String
/**
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
}
}