Failed to generate token: secretOrPrivateKey must be an asymmetric key when using ES256
I have an iOS mobile application (https://apps.apple.com/us/app/ferienhausmiete/id6475052679) generated by PWABuilder. I setup Novu for sending push notifications via APNs provider. I am sending POST request to
https://eu.api.novu.co/v1/events/trigger
with PostMan and getting this response
{
"data": {
"acknowledged": true,
"status": "processed",
"transactionId": "29861fe0-f8c5-4126-9f03-fc56e97e9eb4"
}
}
but in Activity Feed page I have an Error (check the screenshot).
I have double checked Key ID
, Team ID
, Bundle ID
. With Private Key
I made more checks. Private Key format is correct, I copy/paste it from AuthKey_XXX.p8
file (including -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- parts), I verified it with openssl ec -in AuthKey_XXX.p8 -text -noout
command and the result was like this
read EC key
Private-Key: (256 bit)
priv:
XX:XX:XX...
pub:
XX:XX:XX...
ASN1 OID: prime256v1
NIST CURVE: P-256
which means that everything is correct. On application side everything looks correct, after instalation I am asking for a permision to send notifications.
Please help me to figure out with this problem. Let me know if you need more information/data to help me.
Thanks in advance.
4 Replies
@Narek
Thanks for sharing the details. I will look into this and will update
Hi @Pawan Jain , had you chance to check my case, thanks in advance
Hey Narek
I did check this from my end. APNS Integration credentials is correct. I have applied for apple developer account so that I can test the apns integration with my credentials. I will keep you updated
I did check this from my end. APNS Integration credentials is correct. I have applied for apple developer account so that I can test the apns integration with my credentials. I will keep you updated
Thank you very much @Pawan Jain
Hi @Pawan Jain , have you some progress for this or maybe any suggestion how can I try some other way to fix this problem?
I have tried to update the Private Key also via API requests, as I saw there was such problem a long times ago, but the result is same and I really stacked with this. With Android everything goes very smooth and I want to have the same result with iOS too 🙂 .