Skip to content

Commit 0d016e4

Browse files
authored
Fix sendable conformance (#171)
1 parent ecf0f44 commit 0d016e4

14 files changed

+17
-17
lines changed

Sources/APNS/APNSConfiguration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import NIOTLS
1919
import AsyncHTTPClient
2020

2121
/// The configuration of an ``APNSClient``.
22-
public struct APNSClientConfiguration {
22+
public struct APNSClientConfiguration: Sendable {
2323
/// The authentication method used by the ``APNSClient``.
24-
public struct AuthenticationMethod {
24+
public struct AuthenticationMethod: Sendable {
2525
internal enum Method {
2626
case jwt(privateKey: P256.Signing.PrivateKey, teamIdentifier: String, keyIdentifier: String)
2727
case tls(privateKey: NIOSSLPrivateKeySource, certificateChain: [NIOSSLCertificateSource])

Sources/APNSCore/APNSEnvironment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
/// The APNs environment.
16-
public struct APNSEnvironment {
16+
public struct APNSEnvironment: Sendable {
1717
/// The production APNs environment.
1818
public static let production = Self(url: "https://api.push.apple.com", port: 443)
1919

Sources/APNSCore/APNSPushType.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
/// A struct which represents the different supported APNs push types.
16-
public struct APNSPushType: Hashable {
17-
public enum Configuration: String, Hashable {
16+
public struct APNSPushType: Hashable, Sendable {
17+
public enum Configuration: String, Hashable, Sendable {
1818
case alert
1919
case background
2020
case location

Sources/APNSCore/Alert/APNSAlertNotification.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import struct Foundation.UUID
1818
///
1919
/// - Important: Your dynamic payload will get encoded to the root of the JSON payload that is send to APNs.
2020
/// It is **important** that you do not encode anything with the key `aps`.
21-
public struct APNSAlertNotification<Payload: Encodable>: APNSMessage, Sendable {
21+
public struct APNSAlertNotification<Payload: Encodable & Sendable>: APNSMessage, Sendable {
2222
enum CodingKeys: CodingKey {
2323
case aps
2424
}

Sources/APNSCore/Alert/APNSClient+Alert.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension APNSClientProtocol {
2626
/// - logger: The logger to use for sending this notification.
2727
@discardableResult
2828
@inlinable
29-
public func sendAlertNotification<Payload: Encodable>(
29+
public func sendAlertNotification<Payload: Encodable & Sendable>(
3030
_ notification: APNSAlertNotification<Payload>,
3131
deviceToken: String
3232
) async throws -> APNSResponse {

Sources/APNSCore/Background/APNSBackgroundNotification.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import struct Foundation.UUID
1818
///
1919
/// - Important: Your dynamic payload will get encoded to the root of the JSON payload that is send to APNs.
2020
/// It is **important** that you do not encode anything with the key `aps`.
21-
public struct APNSBackgroundNotification<Payload: Encodable>: APNSMessage {
21+
public struct APNSBackgroundNotification<Payload: Encodable & Sendable>: APNSMessage {
2222
@usableFromInline
23-
struct APS: Encodable {
23+
struct APS: Encodable, Sendable {
2424
enum CodingKeys: String, CodingKey {
2525
case contentAvailable = "content-available"
2626
}

Sources/APNSCore/Background/APNSClient+Background.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension APNSClientProtocol {
2626
/// - logger: The logger to use for sending this notification.
2727
@discardableResult
2828
@inlinable
29-
public func sendBackgroundNotification<Payload: Encodable>(
29+
public func sendBackgroundNotification<Payload: Encodable & Sendable>(
3030
_ notification: APNSBackgroundNotification<Payload>,
3131
deviceToken: String
3232
) async throws -> APNSResponse {

Sources/APNSCore/Complication/APNSClient+Complication.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension APNSClientProtocol {
2525
/// - logger: The logger to use for sending this notification.
2626
@discardableResult
2727
@inlinable
28-
public func sendComplicationNotification<Payload: Encodable>(
28+
public func sendComplicationNotification<Payload: Encodable & Sendable>(
2929
_ notification: APNSComplicationNotification<Payload>,
3030
deviceToken: String
3131
) async throws -> APNSResponse {

Sources/APNSCore/Complication/APNSComplicationNotification.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import struct Foundation.UUID
1616

1717
/// A complication notification.
18-
public struct APNSComplicationNotification<Payload: Encodable>: APNSMessage {
18+
public struct APNSComplicationNotification<Payload: Encodable & Sendable>: APNSMessage {
1919
/// A canonical UUID that identifies the notification. If there is an error sending the notification,
2020
/// APNs uses this value to identify the notification to your server. The canonical form is 32 lowercase hexadecimal digits,
2121
/// displayed in five groups separated by hyphens in the form 8-4-4-4-12. An example UUID is as follows:

Sources/APNSCore/FileProvider/APNSClient+FileProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension APNSClientProtocol {
2525
/// - logger: The logger to use for sending this notification.
2626
@discardableResult
2727
@inlinable
28-
public func sendFileProviderNotification<Payload: Encodable>(
28+
public func sendFileProviderNotification<Payload: Encodable & Sendable>(
2929
_ notification: APNSFileProviderNotification<Payload>,
3030
deviceToken: String
3131
) async throws -> APNSResponse {

0 commit comments

Comments
 (0)