N
Novu2w ago
sikmin

Help Needed: APNS Push Notification ES256 JWT Error

Hello, I'm trying to implement Apple Push Notification Service (APNS) in my app and encountering a JWT authentication error. I need some assistance. Problem Description When trying to send push notifications, I get the following error:
{
"jse_shortmsg": "Failed to generate token",
"jse_cause": {},
"jse_info": {},
"message": "Failed to generate token: secretOrPrivateKey must be an asymmetric key when using ES256"
}
{
"jse_shortmsg": "Failed to generate token",
"jse_cause": {},
"jse_info": {},
"message": "Failed to generate token: secretOrPrivateKey must be an asymmetric key when using ES256"
}
What I've Tried I've generated certificates and keys from my Apple Developer account and downloaded the p8 file. I'm trying to authenticate to APNS using this key. Looking at the error message secretOrPrivateKey must be an asymmetric key when using ES256, it seems that when generating the JWT token using the ES256 algorithm, the provided key is either not in the correct asymmetric key format or is not being loaded properly. this is p8 file content < Private Key input value -----BEGIN PRIVATE KEY----- (codes) -----END PRIVATE KEY-----
6 Replies
sikmin
sikminOP2w ago
Help!
Pawan Jain
Pawan Jain2w ago
@sikmin Could you please share transactionId from activity feed page?
sikmin
sikminOP2w ago
4cfde96f-4362-412a-8582-ec54b9500ea4 Thanks!
Pawan Jain
Pawan Jain2w ago
@sikmin I am able to reproduce the issue. I will keep you updated on the fix
sikmin
sikminOP2w ago
Thanks Pawan, I'll be waiting for the update! novu is a really cool service. I want to use novu pro, but I have difficulty setting up my service because of an APNS error. Is there any update I can refer to?
Pawan Jain
Pawan Jain7d ago
hey 👋🏻 it is taking a bit longer than expected to fix this bug. I will push the team on this

Did you find this page helpful?