Unexpected provider error: Cannot read properties of undefined (reading 'reason')
Hi. We have this issue when we try to send a push notification to subscriber with APNS Provider for IOS devices.
Here is a channel`s example of the subscriber in Novu MongoDB:
[{"credentials": {"deviceTokens": ["<device_token>"]}, "_integrationId": "<integrationId>", "providerId": "apns"}]
_integrationId has connection with correct APNS Provider.
Trigger information in Activity Feed Novu:
curl --location --request POST '<trigger_api>' \
--header 'Authorization: ApiKey <REPLACE_WITH_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "info-push",
"to": {
"subscriberId": "<subscriberId>"
},
"payload": {
"notification_service_id": "<notification_service_id>",
"title": "Test",
"body": "Test",
"push_type": "basic"
},
"overrides": {
"apns": {
"type": "data"
}
}
}'
Novu version 0.24.3
Novu API version 0.24
What this message even mean and how to fix it?
2 Replies
@Vadim Poliakov
I could find this in our codebase related to this error
https://github.com/novuhq/novu/blob/fix/webhook-url-for-integration/packages/providers/src/lib/push/apns/apns.provider.ts#L73
Did it started happening recently?
We solved this problem by downgrading Novu version from 0.24 to 0.20. In this version works APNS provider, but FCM provider doesn`t because of deprecated method in Google API. So we have just rewrote this method in 0.20 and all push notifications started work.