diff --git a/Sources/APNS/APNSClient.swift b/Sources/APNS/APNSClient.swift index a1c3826..2e648ed 100644 --- a/Sources/APNS/APNSClient.swift +++ b/Sources/APNS/APNSClient.swift @@ -125,7 +125,7 @@ public final class APNSClient Void) { + @preconcurrency public func shutdown(queue: DispatchQueue = .global(), callback: @Sendable @escaping (Error?) -> Void) { self.httpClient.shutdown(callback) } diff --git a/Sources/APNS/APNSConfiguration.swift b/Sources/APNS/APNSConfiguration.swift index c2392a8..ba62c6d 100644 --- a/Sources/APNS/APNSConfiguration.swift +++ b/Sources/APNS/APNSConfiguration.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import APNSCore -import Crypto +@preconcurrency import Crypto import NIOSSL import NIOTLS import AsyncHTTPClient @@ -22,7 +22,7 @@ import AsyncHTTPClient public struct APNSClientConfiguration: Sendable { /// The authentication method used by the ``APNSClient``. public struct AuthenticationMethod: Sendable { - internal enum Method { + internal enum Method : Sendable{ case jwt(privateKey: P256.Signing.PrivateKey, teamIdentifier: String, keyIdentifier: String) case tls(privateKey: NIOSSLPrivateKeySource, certificateChain: [NIOSSLCertificateSource]) } diff --git a/Sources/APNSCore/APNSError.swift b/Sources/APNSCore/APNSError.swift index 41bd2c6..4a7c0b6 100644 --- a/Sources/APNSCore/APNSError.swift +++ b/Sources/APNSCore/APNSError.swift @@ -21,8 +21,8 @@ public struct APNSError: Error { /// The error reason returned by APNs. /// /// For more information please look here: [Reference]( https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/handling_notification_responses_from_apns) - public struct ErrorReason: Hashable { - public enum Reason: RawRepresentable, Hashable { + public struct ErrorReason: Hashable, Sendable { + public enum Reason: RawRepresentable, Hashable, Sendable { public typealias RawValue = String case badCollapseIdentifier diff --git a/Sources/APNSCore/Base64.swift b/Sources/APNSCore/Base64.swift index 46bd3f2..c78fa67 100644 --- a/Sources/APNSCore/Base64.swift +++ b/Sources/APNSCore/Base64.swift @@ -89,7 +89,7 @@ internal enum Base64 {} extension Base64 { @usableFromInline - internal struct EncodingOptions: OptionSet { + internal struct EncodingOptions: OptionSet, Sendable { @usableFromInline internal let rawValue: UInt @@ -557,7 +557,7 @@ extension Base64 { extension Base64 { @usableFromInline - internal struct DecodingOptions: OptionSet { + internal struct DecodingOptions: OptionSet, Sendable { @usableFromInline internal let rawValue: UInt diff --git a/Sources/APNSCore/LiveActivity/APNSLiveActivityDismissalDate.swift b/Sources/APNSCore/LiveActivity/APNSLiveActivityDismissalDate.swift index cb1112d..9bd7d4e 100644 --- a/Sources/APNSCore/LiveActivity/APNSLiveActivityDismissalDate.swift +++ b/Sources/APNSCore/LiveActivity/APNSLiveActivityDismissalDate.swift @@ -14,7 +14,7 @@ import struct Foundation.Date -public struct APNSLiveActivityDismissalDate: Hashable { +public struct APNSLiveActivityDismissalDate: Hashable, Sendable { /// The date at which the live activity will be dismissed /// This value is a UNIX epoch expressed in seconds (UTC) @usableFromInline diff --git a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift index 135a193..358d16b 100644 --- a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift +++ b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift @@ -17,7 +17,7 @@ import struct Foundation.UUID /// A live activity notification. /// /// It is **important** that you do not encode anything with the key `aps`. -public struct APNSLiveActivityNotification: APNSMessage { +public struct APNSLiveActivityNotification: APNSMessage { enum CodingKeys: CodingKey { case aps } diff --git a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationAPSStorage.swift b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationAPSStorage.swift index 756c747..7bde976 100644 --- a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationAPSStorage.swift +++ b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationAPSStorage.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -struct APNSLiveActivityNotificationAPSStorage: Encodable { +struct APNSLiveActivityNotificationAPSStorage: Encodable { enum CodingKeys: String, CodingKey { case timestamp = "timestamp" case event = "event" diff --git a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationEvent.swift b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationEvent.swift index 9f925f8..b0f6ca2 100644 --- a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationEvent.swift +++ b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotificationEvent.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -public struct APNSLiveActivityNotificationEvent: Hashable { +public struct APNSLiveActivityNotificationEvent: Hashable, Sendable { /// The underlying raw value that is send to APNs. @usableFromInline internal let rawValue: String diff --git a/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift b/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift index 4a72246..0c5c9d2 100644 --- a/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift +++ b/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift @@ -17,7 +17,7 @@ import struct Foundation.UUID /// A notification that starts a live activity /// /// It is **important** that you do not encode anything with the key `aps`. -public struct APNSStartLiveActivityNotification: +public struct APNSStartLiveActivityNotification: APNSMessage { enum CodingKeys: CodingKey { diff --git a/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotificationAPSStorage.swift b/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotificationAPSStorage.swift index 2fd1947..58ddb35 100644 --- a/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotificationAPSStorage.swift +++ b/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotificationAPSStorage.swift @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -struct APNSStartLiveActivityNotificationAPSStorage: - Encodable +struct APNSStartLiveActivityNotificationAPSStorage: + Encodable & Sendable { enum CodingKeys: String, CodingKey { case timestamp = "timestamp" diff --git a/Sources/APNSURLSession/APNSURLSessionClientConfiguration.swift b/Sources/APNSURLSession/APNSURLSessionClientConfiguration.swift index e89dae9..501a6cc 100644 --- a/Sources/APNSURLSession/APNSURLSessionClientConfiguration.swift +++ b/Sources/APNSURLSession/APNSURLSessionClientConfiguration.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import APNSCore -import Crypto +@preconcurrency import Crypto /// The configuration of an ``APNSURLSessionClient``. public struct APNSURLSessionClientConfiguration {