@@ -29,6 +29,9 @@ public final class APNSBroadcastClient<Decoder: APNSJSONDecoder & Sendable, Enco
2929 /// The broadcast environment to use.
3030 private let environment : APNSBroadcastEnvironment
3131
32+ /// The app's bundle identifier used in the API path.
33+ private let bundleID : String
34+
3235 /// The ``HTTPClient`` used by the APNS broadcast client.
3336 private let httpClient : HTTPClient
3437
@@ -62,19 +65,22 @@ public final class APNSBroadcastClient<Decoder: APNSJSONDecoder & Sendable, Enco
6265 /// - Parameters:
6366 /// - authenticationMethod: The authentication method to use.
6467 /// - environment: The broadcast environment (production or sandbox).
68+ /// - bundleID: The app's bundle identifier (e.g., "com.example.myapp").
6569 /// - eventLoopGroupProvider: Specify how EventLoopGroup will be created.
6670 /// - responseDecoder: The decoder for the responses from APNs.
6771 /// - requestEncoder: The encoder for the requests to APNs.
6872 /// - byteBufferAllocator: The `ByteBufferAllocator`.
6973 public init (
7074 authenticationMethod: APNSClientConfiguration . AuthenticationMethod ,
7175 environment: APNSBroadcastEnvironment ,
76+ bundleID: String ,
7277 eventLoopGroupProvider: NIOEventLoopGroupProvider ,
7378 responseDecoder: Decoder ,
7479 requestEncoder: Encoder ,
7580 byteBufferAllocator: ByteBufferAllocator = . init( )
7681 ) {
7782 self . environment = environment
83+ self . bundleID = bundleID
7884 self . byteBufferAllocator = byteBufferAllocator
7985 self . responseDecoder = responseDecoder
8086 self . requestEncoder = requestEncoder
@@ -140,7 +146,7 @@ extension APNSBroadcastClient {
140146 }
141147
142148 // Build the request URL
143- let requestURL = " \( self . environment. url) : \( self . environment. port) \( request. operation. path) "
149+ let requestURL = " \( self . environment. url) : \( self . environment. port) /1/apps/ \( self . bundleID ) \( request. operation. path) "
144150
145151 // Create HTTP request
146152 var httpClientRequest = HTTPClientRequest ( url: requestURL)
0 commit comments