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
6 changes: 6 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: test
on:
- pull_request
jobs:
foundation-linking:
uses: vapor/ci/.github/workflows/check-foundation-linking.yml@main
permissions:
contents: read
with:
excluded_products: 'APNSURLSession APNSTestServer'
focal:
container:
image: swift:6.2-bookworm
Expand Down
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ let package = Package(
.target(name: "APNSCore"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "Crypto", package: "swift-crypto"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOTLS", package: "swift-nio"),
Expand Down
5 changes: 2 additions & 3 deletions Sources/APNS/Coding/APNSJSONDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import FoundationEssentials
import Foundation
#endif
import NIOCore
import NIOFoundationCompat

/// A protocol that is similar to the `JSONDecoder`. This allows users of APNSwift to customize the decoder used
/// for decoding the APNS response bodies.
Expand All @@ -29,7 +28,7 @@ public protocol APNSJSONDecoder {
extension JSONDecoder: APNSJSONDecoder {
public func decode<T: Decodable>(_ type: T.Type, from buffer: ByteBuffer) throws -> T {
var copy = buffer
let data = copy.readData(length: buffer.readableBytes)!
return try self.decode(type, from: data)
let bytes = copy.readBytes(length: buffer.readableBytes)!
return try self.decode(type, from: Data(bytes))
}
}
3 changes: 1 addition & 2 deletions Sources/APNS/Coding/APNSJSONEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import FoundationEssentials
import Foundation
#endif
import NIOCore
import NIOFoundationCompat

/// A protocol that is similar to the `JSONEncoder`. This allows users of APNSwift to customize the encoder used
/// for encoding the notification JSON payloads.
Expand All @@ -29,6 +28,6 @@ public protocol APNSJSONEncoder {
extension JSONEncoder: APNSJSONEncoder {
public func encode<T: Encodable>(_ value: T, into buffer: inout ByteBuffer) throws {
let data = try encode(value)
buffer.writeData(data)
buffer.writeBytes(data)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//

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

public struct APNSLiveActivityDismissalDate: Hashable, Sendable {
/// The date at which the live activity will be dismissed
Expand Down