I'm having 403 "InvalidProviderToken" when sending push notifications.
I tried parsing the JWT token it sends and it appears to be parsed alright.
Key, KeyID and TeamID are valid and were tested with both Firebase and different library in a separate dotnet service, so that's definitely not the issue.
I tried issuing new keys (Apple allows to have two keys simultaneously) as a second key, but none of them worked.
I tried running the code both from Windows and MacOS, so root certificate is not a problem too.
The code (simplified):
const APNProvider = new apn.Provider({
token: {
key: Environment.CONNECT_APN_KEY_PATH,
keyId: Environment.CONNECT_APN_KEY_ID,
teamId: Environment.CONNECT_APN_TEAM_ID,
},
});
// <... time passes and someone finally decides to send a message to other user ...>
const res = await APNProvider.send(notification, recipients);
console.log(res)
I'm having 403 "InvalidProviderToken" when sending push notifications. I tried parsing the JWT token it sends and it appears to be parsed alright. Key, KeyID and TeamID are valid and were tested with both Firebase and different library in a separate dotnet service, so that's definitely not the issue.
I tried issuing new keys (Apple allows to have two keys simultaneously) as a second key, but none of them worked. I tried running the code both from Windows and MacOS, so root certificate is not a problem too.
The code (simplified):
So, the response:
Am I missing something?