N
Novuā€¢16mo ago
serafeimo

APNS error while sending notification (v 0.12.0)

Hi all! I'm trying to send push notification using APNS (since the topicID issue has been fixed in 0.12.0 - thanks for that! ). I have configured and activated the provider but when I trigger the notification I get an error without any helpful message: { "stack": "Error: \n at APNSPushProvider.<anonymous> (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:84:35)\n at step (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:44:23)\n at Object.next (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:25:53)\n at fulfilled (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:16:58)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)", "message": "" } The request I use is the following: { "name": "ios-test", "to": { "subscriberId": "sera-12345" }, "payload": { }, "overrides": { } } I'd appreciate any thoughts on this.
17 Replies
Pawan Jain
Pawan Jainā€¢16mo ago
Did you duble check your APNS creds?
serafeimo
serafeimoā€¢16mo ago
I'm trying to turn production on (in APNS provider's config) to check if there is an issue in sandbox but the toggle button doesn't seem to work..
serafeimo
serafeimoā€¢16mo ago
serafeimo
serafeimoā€¢16mo ago
I tried from both development and production environments. I'm using a valid token and I managed to send a notification from "Swifty Pusher" (test notification app). However, I noticed that I can only send it successfully using prod. In sandbox I'm getting a bad token error. So, I think that it might work if I could turn APNS provider to production.. To help you more, when I turn Novu environment to production I get the same error but with a message this time which is also weird šŸ˜… Error from development: { "stack": "Error: \n at APNSPushProvider.<anonymous> (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:84:35)\n at step (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:44:23)\n at Object.next (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:25:53)\n at fulfilled (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:16:58)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)", "message": "" } Error from production: { "stack": "Error: 85a57fd53908d108da4c3fe1da073677c418e3bb7674f96e2cb46bcc69eb8a3c failed for reason: BadDeviceToken\n at APNSPushProvider.<anonymous> (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:84:35)\n at step (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:44:23)\n at Object.next (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:25:53)\n at fulfilled (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:16:58)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)", "message": "85a57fd53908d108da4c3fe1da073677c418e3bb7674f96e2cb46bcc69eb8a3c failed for reason: BadDeviceToken" } Do you know if the "Production" toggle button is supposed to work or if there is another way to set it to true (maybe with an API call to update the integration?) I managed to set production to ON by creating the APNS integration with an API call: { "providerId": "apns", "channel": "push", "credentials": { "secretKey": "-----BEGIN PRIVATE KEY-----scscds-----END PRIVATE KEY-----", "apiKey": "asdasdasdsa", "projectName": "adadsadsa", "applicationId": "com.aryansbtloe.apns-tester.sample.ios", "secure": true }, "active": true, "check": true } The field secure is the one that maps to production toggle. However, I'm still getting the same error for a valid token which is reachable from other testing apps..
Pawan Jain
Pawan Jainā€¢16mo ago
Now it is working for you?
serafeimo
serafeimoā€¢16mo ago
Pawan Jain
Pawan Jainā€¢16mo ago
Ohh!
serafeimo
serafeimoā€¢16mo ago
Has anyone managed to send an ios push notification?
Pawan Jain
Pawan Jainā€¢16mo ago
Need to check it thoroughly! I have limited knowledge of APNS
serafeimo
serafeimoā€¢16mo ago
I'm attaching the last error from Novu's production environment when trying with a valid token: { "stack": "Error: \n at APNSPushProvider.<anonymous> (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:84:35)\n at step (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:44:23)\n at Object.next (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:25:53)\n at fulfilled (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:16:58)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)", "message": "" } UPDATE: We discovered something interesting today. When we use a valid token, the notification is being received BUT we get an error (with an empty message) and the transaction is marked as failed. { ā€œstackā€: ā€œError: \n at APNSPushProvider.<anonymous> (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:84:35)\n at step (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:44:23)\n at Object.next (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:25:53)\n at fulfilled (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:16:58)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)ā€œ, ā€œmessageā€: ā€œā€ } When we use a wrong token then we get an error with the correct message and the transaction is also being marked as failed. { ā€œstackā€: ā€œError: 85a57fd53908d108da4c3fe1da073677c418e3bb7674f96e2cb46bcc69eb8a3 failed for reason: BadDeviceToken\n at APNSPushProvider.<anonymous> (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:84:35)\n at step (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:44:23)\n at Object.next (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:25:53)\n at fulfilled (/usr/src/app/providers/apns/build/main/lib/apns.provider.js:16:58)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)ā€œ, ā€œmessageā€: ā€œ85a57fd53908d108da4c3fe1da073677c418e3bb7674f96e2cb46bcc69eb8a3 failed for reason: BadDeviceTokenā€ } So, in both cases the transaction is marked as failed but in the first case we actually saw it coming in.
serafeimo
serafeimoā€¢16mo ago
GitHub
[NV-1817] šŸ› Bug Report: APNS delivered notifications marked as fail...
šŸ“œ Description We discovered something interesting while testing APNS integration for sending ios push notifications. When we use a valid token, the notification is being received BUT we get an erro...
GitHub
[NV-1818] šŸ› Bug Report: APNS production toggle can't be turned on (...
šŸ“œ Description In APNS provider there is a Production toggle that, as far as I can tell, defines if the notification will be sent to sandbox or production. This toggle cannot be turned on using the ...
Pawan Jain
Pawan Jainā€¢16mo ago
Thanks @serafeimo
Unknown User
Unknown Userā€¢16mo ago
Message Not Public
Sign In & Join Server To View
BiswaViraj
BiswaVirajā€¢15mo ago
Hello @serafeimo, @omerbenami Both of these issues have been fixed and merged to the next branch, We will release a patch version soon.
serafeimo
serafeimoā€¢15mo ago
That's great news. Thanks @biswaviraj ! Is there an expected date for this patch? Hi all! Is there any update on the release date? Thanks!
Zac Clifton
Zac Cliftonā€¢15mo ago
@serafeimo 0.13.0 is coming out this week
Pawan Jain
Pawan Jainā€¢15mo ago
@serafeimo We have released 0.13.0, let us know if you are still facing this issue