N
Novuā€¢2y 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ā€¢2y ago
Did you duble check your APNS creds?
serafeimo
serafeimoOPā€¢2y 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
serafeimoOPā€¢2y ago
serafeimo
serafeimoOPā€¢2y 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ā€¢2y ago
Now it is working for you?
serafeimo
serafeimoOPā€¢2y ago
Pawan Jain
Pawan Jainā€¢2y ago
Ohh!
serafeimo
serafeimoOPā€¢2y ago
Has anyone managed to send an ios push notification?
Pawan Jain
Pawan Jainā€¢2y ago
Need to check it thoroughly! I have limited knowledge of APNS
serafeimo
serafeimoOPā€¢2y 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
serafeimoOPā€¢2y 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ā€¢2y ago
Thanks @serafeimo
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
BiswaViraj
BiswaVirajā€¢2y 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
serafeimoOPā€¢2y 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ā€¢2y ago
@serafeimo 0.13.0 is coming out this week
Pawan Jain
Pawan Jainā€¢2y ago
@serafeimo We have released 0.13.0, let us know if you are still facing this issue
Want results from more Discord servers?
Add your server