Push-Definitions/Sources/PushAPI/AuthenticatedPushMessage.swift

28 lines
779 B
Swift
Raw Normal View History

2022-06-05 11:47:58 +02:00
import Foundation
/**
A push message to send to the push server.
This structure contains the content of the notification, as well as all data to send the notification to one or more recipients.
The message contains the authorization of the sender as well.
*/
2022-06-05 12:10:38 +02:00
public struct AuthenticatedPushMessage: Codable {
2022-06-05 11:47:58 +02:00
/// The device sending the message
2022-06-05 12:13:47 +02:00
public let sender: DeviceAuthentication
2022-06-05 11:47:58 +02:00
/// The message to send
2022-06-05 12:13:47 +02:00
public let message: PushMessage
2022-06-05 11:47:58 +02:00
2022-06-05 18:25:39 +02:00
/**
Create an authenticated push message
- Parameter sender: The authentication of the sender
- Parameter message: The message metadata and content
*/
public init(sender: DeviceAuthentication, message: PushMessage) {
self.sender = sender
self.message = message
}
2022-06-05 11:47:58 +02:00
}