diff --git a/Sources/APNS/APNSBroadcastClient.swift b/Sources/APNS/APNSBroadcastClient.swift index 8cab9858..d44ff506 100644 --- a/Sources/APNS/APNSBroadcastClient.swift +++ b/Sources/APNS/APNSBroadcastClient.swift @@ -14,8 +14,13 @@ import APNSCore import AsyncHTTPClient +#if canImport(FoundationEssentials) +import struct FoundationEssentials.Date +import struct FoundationEssentials.UUID +#else import struct Foundation.Date import struct Foundation.UUID +#endif import NIOConcurrencyHelpers import NIOCore import NIOHTTP1 diff --git a/Sources/APNS/APNSClient.swift b/Sources/APNS/APNSClient.swift index b9a7dcc7..d7576a30 100644 --- a/Sources/APNS/APNSClient.swift +++ b/Sources/APNS/APNSClient.swift @@ -14,8 +14,13 @@ import APNSCore import AsyncHTTPClient +#if canImport(FoundationEssentials) +import struct FoundationEssentials.Date +import struct FoundationEssentials.UUID +#else import struct Foundation.Date import struct Foundation.UUID +#endif import NIOConcurrencyHelpers import NIOCore import NIOHTTP1 diff --git a/Sources/APNS/Coding/APNSJSONDecoder.swift b/Sources/APNS/Coding/APNSJSONDecoder.swift index 96d0928e..dd06f37f 100644 --- a/Sources/APNS/Coding/APNSJSONDecoder.swift +++ b/Sources/APNS/Coding/APNSJSONDecoder.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif import NIOCore import NIOFoundationCompat diff --git a/Sources/APNS/Coding/APNSJSONEncoder.swift b/Sources/APNS/Coding/APNSJSONEncoder.swift index 1f04a333..364cde27 100644 --- a/Sources/APNS/Coding/APNSJSONEncoder.swift +++ b/Sources/APNS/Coding/APNSJSONEncoder.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif import NIOCore import NIOFoundationCompat diff --git a/Sources/APNSCore/APNSError.swift b/Sources/APNSCore/APNSError.swift index 2106b107..9563eb20 100644 --- a/Sources/APNSCore/APNSError.swift +++ b/Sources/APNSCore/APNSError.swift @@ -12,8 +12,13 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.Date +import struct FoundationEssentials.UUID +#else import struct Foundation.Date import struct Foundation.UUID +#endif /// An error returned by APNs. public struct APNSError: Error { diff --git a/Sources/APNSCore/APNSRequest.swift b/Sources/APNSCore/APNSRequest.swift index 146dc1f5..366b6aee 100644 --- a/Sources/APNSCore/APNSRequest.swift +++ b/Sources/APNSCore/APNSRequest.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif public struct APNSRequest { fileprivate final class _Storage { diff --git a/Sources/APNSCore/APNSResponse.swift b/Sources/APNSCore/APNSResponse.swift index 0963485a..bfa37882 100644 --- a/Sources/APNSCore/APNSResponse.swift +++ b/Sources/APNSCore/APNSResponse.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// The response of a successful APNs request. public struct APNSResponse: Hashable, Sendable { diff --git a/Sources/APNSCore/Alert/APNSAlertNotification.swift b/Sources/APNSCore/Alert/APNSAlertNotification.swift index e302f437..2b24b5d7 100644 --- a/Sources/APNSCore/Alert/APNSAlertNotification.swift +++ b/Sources/APNSCore/Alert/APNSAlertNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// An alert notification. /// diff --git a/Sources/APNSCore/Background/APNSBackgroundNotification.swift b/Sources/APNSCore/Background/APNSBackgroundNotification.swift index 164abf02..bf3c1aec 100644 --- a/Sources/APNSCore/Background/APNSBackgroundNotification.swift +++ b/Sources/APNSCore/Background/APNSBackgroundNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A background notification. /// diff --git a/Sources/APNSCore/Broadcast/APNSBroadcastClientProtocol.swift b/Sources/APNSCore/Broadcast/APNSBroadcastClientProtocol.swift index 28c54586..efefea6f 100644 --- a/Sources/APNSCore/Broadcast/APNSBroadcastClientProtocol.swift +++ b/Sources/APNSCore/Broadcast/APNSBroadcastClientProtocol.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// Protocol defining the broadcast channel management operations. public protocol APNSBroadcastClientProtocol: Sendable { diff --git a/Sources/APNSCore/Broadcast/APNSBroadcastRequest.swift b/Sources/APNSCore/Broadcast/APNSBroadcastRequest.swift index 4f48bfaa..45522a60 100644 --- a/Sources/APNSCore/Broadcast/APNSBroadcastRequest.swift +++ b/Sources/APNSCore/Broadcast/APNSBroadcastRequest.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// Represents a request to the APNs broadcast channel management API. public struct APNSBroadcastRequest: Sendable where Message: Sendable { diff --git a/Sources/APNSCore/Broadcast/APNSBroadcastResponse.swift b/Sources/APNSCore/Broadcast/APNSBroadcastResponse.swift index 9e2d3fb7..ce7ece28 100644 --- a/Sources/APNSCore/Broadcast/APNSBroadcastResponse.swift +++ b/Sources/APNSCore/Broadcast/APNSBroadcastResponse.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// Represents a response from a broadcast channel operation. public struct APNSBroadcastResponse: Sendable where Body: Sendable { diff --git a/Sources/APNSCore/Complication/APNSComplicationNotification.swift b/Sources/APNSCore/Complication/APNSComplicationNotification.swift index 7d0dba1c..30333885 100644 --- a/Sources/APNSCore/Complication/APNSComplicationNotification.swift +++ b/Sources/APNSCore/Complication/APNSComplicationNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A complication notification. public struct APNSComplicationNotification: APNSMessage { diff --git a/Sources/APNSCore/FileProvider/APNSFileProviderNotification.swift b/Sources/APNSCore/FileProvider/APNSFileProviderNotification.swift index d4557e2f..8df8db55 100644 --- a/Sources/APNSCore/FileProvider/APNSFileProviderNotification.swift +++ b/Sources/APNSCore/FileProvider/APNSFileProviderNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A file provider notification. public struct APNSFileProviderNotification: APNSMessage { diff --git a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift index 7127a40b..3f444590 100644 --- a/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift +++ b/Sources/APNSCore/LiveActivity/APNSLiveActivityNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A live activity notification. /// diff --git a/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift b/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift index 1b751b22..dd92d90a 100644 --- a/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift +++ b/Sources/APNSCore/LiveActivity/APNSStartLiveActivityNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A notification that starts a live activity /// diff --git a/Sources/APNSCore/Location/APNSLocationNotification.swift b/Sources/APNSCore/Location/APNSLocationNotification.swift index 5ed2bd1b..508e71d5 100644 --- a/Sources/APNSCore/Location/APNSLocationNotification.swift +++ b/Sources/APNSCore/Location/APNSLocationNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A location notification. public struct APNSLocationNotification: APNSMessage { diff --git a/Sources/APNSCore/PushToTalk/APNSPushToTalkNotification.swift b/Sources/APNSCore/PushToTalk/APNSPushToTalkNotification.swift index dea79305..b6249623 100644 --- a/Sources/APNSCore/PushToTalk/APNSPushToTalkNotification.swift +++ b/Sources/APNSCore/PushToTalk/APNSPushToTalkNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A Push to Talk (PTT) notification. public struct APNSPushToTalkNotification: APNSMessage { diff --git a/Sources/APNSCore/VoIP/APNSVoIPNotification.swift b/Sources/APNSCore/VoIP/APNSVoIPNotification.swift index a50505c7..da82e47c 100644 --- a/Sources/APNSCore/VoIP/APNSVoIPNotification.swift +++ b/Sources/APNSCore/VoIP/APNSVoIPNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A voice-over-IP notification. public struct APNSVoIPNotification: APNSMessage { diff --git a/Sources/APNSCore/Widgets/APNSWidgetsNotification.swift b/Sources/APNSCore/Widgets/APNSWidgetsNotification.swift index 1232eaa6..78be90db 100644 --- a/Sources/APNSCore/Widgets/APNSWidgetsNotification.swift +++ b/Sources/APNSCore/Widgets/APNSWidgetsNotification.swift @@ -12,7 +12,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import struct FoundationEssentials.UUID +#else import struct Foundation.UUID +#endif /// A widget update notification. public struct APNSWidgetsNotification: APNSMessage { diff --git a/Sources/APNSExample/Program.swift b/Sources/APNSExample/Program.swift index bc5dc09e..b7bce40a 100644 --- a/Sources/APNSExample/Program.swift +++ b/Sources/APNSExample/Program.swift @@ -15,7 +15,12 @@ import APNSCore import APNS import Logging +import NIOPosix +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif let logger = Logger(label: "APNSwiftExample")