I have a notification where it sends to the best of:
- Push notifications (via firebase)
- SMS (via AWS SNS) (although Courier calls it ‘Push’)
In the notification call with the nodejs library I’m sending:
{
"message": {
"to": {
"user_id": "a5a0b69e-818e-4817-8326-2d3cbc456d9c"
},
"data": {
"title": "Test title",
"message": "Test message"
},
"template": "1PZP13KJQCM207QDY9RV4BS6EM6P"
}
}
This works fine if the user has a firebase token against their Courier User.
However when I send a userId that only has a mobile number against their account, it still tries to send the Push notification and errors with:
"errorMessage": "ProviderConfigurationError: No device token specified."
How do I get it to skip the Firebase push channel if they don’t have a firebase token on their account?
Note: the mobile number against the user without a token says it’s not verified, does that matter?