Make all properties public
This commit is contained in:
parent
2680ed54a3
commit
96e0da10f3
@ -9,9 +9,9 @@ import Foundation
|
|||||||
public struct AuthenticatedPushMessage: Codable {
|
public struct AuthenticatedPushMessage: Codable {
|
||||||
|
|
||||||
/// The device sending the message
|
/// The device sending the message
|
||||||
let sender: DeviceAuthentication
|
public let sender: DeviceAuthentication
|
||||||
|
|
||||||
/// The message to send
|
/// The message to send
|
||||||
let message: PushMessage
|
public let message: PushMessage
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,13 @@ public struct DeviceAuthentication: Codable {
|
|||||||
|
|
||||||
The token is used to uniquely identify the device.
|
The token is used to uniquely identify the device.
|
||||||
*/
|
*/
|
||||||
let pushToken: PushToken
|
public let pushToken: PushToken
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The authentication token of the device.
|
The authentication token of the device.
|
||||||
|
|
||||||
This token is created by the server during device registration, and used for all subsequent requests.
|
This token is created by the server during device registration, and used for all subsequent requests.
|
||||||
*/
|
*/
|
||||||
let authentication: AuthenticationToken
|
public let authentication: AuthenticationToken
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ import Foundation
|
|||||||
public struct DeviceDecision: Codable {
|
public struct DeviceDecision: Codable {
|
||||||
|
|
||||||
/// The push token of the approved or rejected device.
|
/// The push token of the approved or rejected device.
|
||||||
let pushToken: PushToken
|
public let pushToken: PushToken
|
||||||
|
|
||||||
/// The hash of the master key to authenticate the request.
|
/// The hash of the master key to authenticate the request.
|
||||||
let masterKeyHash: Data
|
public let masterKeyHash: Data
|
||||||
}
|
}
|
||||||
|
@ -6,15 +6,15 @@ import Foundation
|
|||||||
public struct DeviceRegistration: Codable {
|
public struct DeviceRegistration: Codable {
|
||||||
|
|
||||||
/// The push token of the registering device
|
/// The push token of the registering device
|
||||||
let pushToken: PushToken
|
public let pushToken: PushToken
|
||||||
|
|
||||||
/// The application id for which the device wants to register
|
/// The application id for which the device wants to register
|
||||||
let application: ApplicationId
|
public let application: ApplicationId
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A custom name for the device.
|
A custom name for the device.
|
||||||
|
|
||||||
The name is displayed when registered users request a list of all devices in an application.
|
The name is displayed when registered users request a list of all devices in an application.
|
||||||
*/
|
*/
|
||||||
let name: String
|
public let name: String
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@ import Foundation
|
|||||||
public struct PushTokenUpdate: Codable {
|
public struct PushTokenUpdate: Codable {
|
||||||
|
|
||||||
/// The authentication of the requesting device.
|
/// The authentication of the requesting device.
|
||||||
let device: DeviceAuthentication
|
public let device: DeviceAuthentication
|
||||||
|
|
||||||
/// The new push token to register
|
/// The new push token to register
|
||||||
let newToken: PushToken
|
public let newToken: PushToken
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public enum Route: String {
|
|||||||
case sendPushNotification = "push"
|
case sendPushNotification = "push"
|
||||||
|
|
||||||
/// The HTTP method required for the route.
|
/// The HTTP method required for the route.
|
||||||
var httpMethod: String {
|
public var httpMethod: String {
|
||||||
// Currently all routes expect `POST` requests.
|
// Currently all routes expect `POST` requests.
|
||||||
return "POST"
|
return "POST"
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ public enum Route: String {
|
|||||||
- Parameter server: The url of the server.
|
- Parameter server: The url of the server.
|
||||||
- Returns: The url to the route.
|
- Returns: The url to the route.
|
||||||
*/
|
*/
|
||||||
func url(for server: URL) -> URL {
|
public func url(for server: URL) -> URL {
|
||||||
server.appendingPathComponent(rawValue)
|
server.appendingPathComponent(rawValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,12 @@ public struct PushMessage: Codable {
|
|||||||
/**
|
/**
|
||||||
A list of push tokens for all recipients of the message
|
A list of push tokens for all recipients of the message
|
||||||
*/
|
*/
|
||||||
let recipients: [PushToken]
|
public let recipients: [PushToken]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The notification content.
|
The notification content.
|
||||||
*/
|
*/
|
||||||
let payload: APNSwiftPayload
|
public let payload: APNSwiftPayload
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The value of this header must accurately reflect the contents of your notification’s payload.
|
The value of this header must accurately reflect the contents of your notification’s payload.
|
||||||
@ -23,7 +23,7 @@ public struct PushMessage: Codable {
|
|||||||
If there’s a mismatch, or if the header is missing on required systems, APNs may return an error, delay the delivery of the notification, or drop it altogether.
|
If there’s a mismatch, or if the header is missing on required systems, APNs may return an error, delay the delivery of the notification, or drop it altogether.
|
||||||
- Note: Required for watchOS 6 and later; recommended for macOS, iOS, tvOS, and iPadOS
|
- Note: Required for watchOS 6 and later; recommended for macOS, iOS, tvOS, and iPadOS
|
||||||
*/
|
*/
|
||||||
let pushType: APNSwiftConnection.PushType
|
public let pushType: APNSwiftConnection.PushType
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The date at which the notification is no longer valid.
|
The date at which the notification is no longer valid.
|
||||||
@ -32,7 +32,7 @@ public struct PushMessage: Codable {
|
|||||||
|
|
||||||
A single APNs attempt may involve retries over multiple network interfaces and connections of the destination device. Often these retries span over some time period, depending on the network characteristics. In addition, a push notification may take some time on the network after APNs sends it to the device. APNs uses best efforts to honor the expiry date without any guarantee. If the value is not `nil`, the notification may be delivered after the mentioned date. If the value is `nil`, the notification may be delivered with some delay.
|
A single APNs attempt may involve retries over multiple network interfaces and connections of the destination device. Often these retries span over some time period, depending on the network characteristics. In addition, a push notification may take some time on the network after APNs sends it to the device. APNs uses best efforts to honor the expiry date without any guarantee. If the value is not `nil`, the notification may be delivered after the mentioned date. If the value is `nil`, the notification may be delivered with some delay.
|
||||||
*/
|
*/
|
||||||
let expiration: Date?
|
public let expiration: Date?
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The priority of the notification.
|
The priority of the notification.
|
||||||
@ -40,21 +40,21 @@ public struct PushMessage: Codable {
|
|||||||
Set `lowPriority = false` to send the notification immediately.
|
Set `lowPriority = false` to send the notification immediately.
|
||||||
Set `lowPriority = true` to send the notification based on power considerations on the user’s device.
|
Set `lowPriority = true` to send the notification based on power considerations on the user’s device.
|
||||||
*/
|
*/
|
||||||
let lowPriority: Bool
|
public let lowPriority: Bool
|
||||||
|
|
||||||
/**
|
/**
|
||||||
An identifier you use to coalesce multiple notifications into a single notification for the user.
|
An identifier you use to coalesce multiple notifications into a single notification for the user.
|
||||||
|
|
||||||
Typically, each notification request causes a new notification to be displayed on the user’s device. When sending the same notification more than once, use the same value in this header to coalesce the requests. The value of this key must not exceed 64 bytes.
|
Typically, each notification request causes a new notification to be displayed on the user’s device. When sending the same notification more than once, use the same value in this header to coalesce the requests. The value of this key must not exceed 64 bytes.
|
||||||
*/
|
*/
|
||||||
let collapseIdentifier: String?
|
public let collapseIdentifier: String?
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The topic for the notification.
|
The topic for the notification.
|
||||||
|
|
||||||
In general, the topic is your app’s bundle ID/app ID. It can have a suffix based on the type of push notification. If you’re using a certificate that supports PushKit VoIP or watchOS complication notifications, you must include this header with bundle ID of you app and if applicable, the proper suffix. If you’re using token-based authentication with APNs, you must include this header with the correct bundle ID and suffix combination. To learn more about app ID, see [Register an App ID](https://help.apple.com/developer-account/#/dev1b35d6f83).
|
In general, the topic is your app’s bundle ID/app ID. It can have a suffix based on the type of push notification. If you’re using a certificate that supports PushKit VoIP or watchOS complication notifications, you must include this header with bundle ID of you app and if applicable, the proper suffix. If you’re using token-based authentication with APNs, you must include this header with the correct bundle ID and suffix combination. To learn more about app ID, see [Register an App ID](https://help.apple.com/developer-account/#/dev1b35d6f83).
|
||||||
*/
|
*/
|
||||||
let topic: String?
|
public let topic: String?
|
||||||
}
|
}
|
||||||
|
|
||||||
extension APNSwiftConnection.PushType: Codable {
|
extension APNSwiftConnection.PushType: Codable {
|
||||||
|
Loading…
Reference in New Issue
Block a user