Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Sources/APNS/APNSBroadcastClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Sources/APNS/APNSClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNS/Coding/APNSJSONDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
import NIOCore
import NIOFoundationCompat

Expand Down
4 changes: 4 additions & 0 deletions Sources/APNS/Coding/APNSJSONEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
import NIOCore
import NIOFoundationCompat

Expand Down
5 changes: 5 additions & 0 deletions Sources/APNSCore/APNSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/APNSRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

public struct APNSRequest<Message: APNSMessage> {
fileprivate final class _Storage {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/APNSResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/Alert/APNSAlertNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

/// An alert notification.
///
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/Background/APNSBackgroundNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

/// A background notification.
///
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/Broadcast/APNSBroadcastClientProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/Broadcast/APNSBroadcastRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Message: Encodable>: Sendable where Message: Sendable {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/Broadcast/APNSBroadcastResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Body: Decodable>: Sendable where Body: Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

/// A complication notification.
public struct APNSComplicationNotification<Payload: Encodable & Sendable>: APNSMessage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

/// A file provider notification.
public struct APNSFileProviderNotification<Payload: Encodable & Sendable>: APNSMessage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

/// A live activity notification.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

/// A notification that starts a live activity
///
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/Location/APNSLocationNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

#if canImport(FoundationEssentials)
import struct FoundationEssentials.UUID
#else
import struct Foundation.UUID
#endif

/// A location notification.
public struct APNSLocationNotification: APNSMessage {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/PushToTalk/APNSPushToTalkNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Payload: Encodable & Sendable>: APNSMessage {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/VoIP/APNSVoIPNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Payload: Encodable & Sendable>: APNSMessage {
Expand Down
4 changes: 4 additions & 0 deletions Sources/APNSCore/Widgets/APNSWidgetsNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions Sources/APNSExample/Program.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down