Add iOS 18+ Broadcast Push Notifications Support #230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements support for Apple's broadcast push notification channels introduced in iOS 18, addressing #205.
Overview
This PR adds complete broadcast channel management functionality to APNSwift, allowing developers to create, read, update, and delete broadcast channels through Apple's broadcast API.
What's New
Core Implementation (APNSCore)
Client Implementation (APNS)
Test Infrastructure (APNSTestServer)
Tests
Usage Example
let client = APNSBroadcastClient(
authenticationMethod: .jwt(
privateKey: privateKey,
keyIdentifier: "KEY_ID",
teamIdentifier: "TEAM_ID"
),
environment: .production,
eventLoopGroupProvider: .createNew,
responseDecoder: JSONDecoder(),
requestEncoder: JSONEncoder()
)
// Create a broadcast channel
let channel = APNSBroadcastChannel(messageStoragePolicy: .mostRecentMessageStored)
let response = try await client.create(channel: channel)
let channelID = response.body.channelID!
// List all channels
let allChannels = try await client.readAllChannelIDs()
// Delete a channel
try await client.delete(channelID: channelID)
Implementation Details
Changes from Original Branch
This PR builds on the work started in https://github.com/eliperkins/APNSwift/tree/channels but completes the implementation:
Testing
Run all tests
swift test
Run only broadcast tests
swift test --filter Broadcast
Documentation
See BROADCAST_CHANNELS.md for:
Related
Closes #205