Closed hakarim740-com-ra closed 1 month ago
Can you share your config?
Can you share your config?
let apnsConfig = APNSClientConfiguration(
authenticationMethod: .tls(
privateKey: .file(".../voip_apns_key.p12.pem"),
certificateChain: [ ]),
environment: .development
)
.file
isn't something supported by APNS, can you share that part of your code?
.file
isn't something supported by APNS, can you share that part of your code?
It is available in NIOSSLCertificateSource
enum
Gotcha, I just tried this and it worked for me, I had to make my own group though to get it to work.
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
let client = APNSClient(
configuration: .init(
authenticationMethod: .tls(
privateKey: .privateKey(try! .init(file: "/Users/kyle/Developer/Certificates.pem", format: .pem)),
certificateChain: [
.certificate(try! .init(file: "/Users/kyle/Developer/Certificates.pem", format: .pem))
]
),
environment: .development
),
eventLoopGroupProvider: .shared(group),
responseDecoder: JSONDecoder(),
requestEncoder: JSONEncoder()
)
Gotcha, I just tried this and it worked for me, I had to make my own group though to get it to work.
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) let client = APNSClient( configuration: .init( authenticationMethod: .tls( privateKey: .privateKey(try! .init(file: "/Users/kyle/Developer/Certificates.pem", format: .pem)), certificateChain: [ .certificate(try! .init(file: "/Users/kyle/Developer/Certificates.pem", format: .pem)) ] ), environment: .development ), eventLoopGroupProvider: .shared(group), responseDecoder: JSONDecoder(), requestEncoder: JSONEncoder() )
Providing the certificateChain
solved it for me.
Thanks.
Describe the bug When using
tls
authentication method I receiveMissingProviderToken
error.Expected behavior The push is supposed to be sent successfully.
Screenshots If applicable, add screenshots to help explain your problem.
Platform:
Platform: