File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1515/// A struct for the error response of APNs.
1616///
1717/// This is just used to decode the JSON and should not be exposed.
18- public struct APNSErrorResponse : Codable {
18+ public struct APNSErrorResponse : Codable , Sendable {
1919 /// The error code indicating the reason for the failure.
2020 public var reason : String
2121
Original file line number Diff line number Diff line change 1515import struct Foundation. UUID
1616
1717/// The response of a successful APNs request.
18- public struct APNSResponse : Hashable {
18+ public struct APNSResponse : Hashable , Sendable {
1919 /// The same value as the `apnsID` send in the request.
2020 ///
2121 /// Use this value to identify the notification. If you don’t specify an `apnsID` in your request,
Original file line number Diff line number Diff line change @@ -50,3 +50,18 @@ final class APNSClientTests: XCTestCase {
5050 -----END PRIVATE KEY-----
5151 """
5252}
53+
54+ // This doesn't perform any runtime tests, it just ensures the call to sendAlertNotification
55+ // compiles when called within an actor's isolation context.
56+ actor TestActor {
57+ func sendAlert( client: APNSClient < JSONDecoder , JSONEncoder > ) async throws {
58+ let notification = APNSAlertNotification (
59+ alert: . init( title: . raw( " title " ) ) ,
60+ expiration: . immediately,
61+ priority: . immediately,
62+ topic: " " ,
63+ payload: " "
64+ )
65+ try await client. sendAlertNotification ( notification, deviceToken: " " )
66+ }
67+ }
You can’t perform that action at this time.
0 commit comments