ProviderConfigurationError: No device token specified

I have a notification where it sends to the best of:

  1. Push notifications (via firebase)
  2. 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?

Screenshot 2023-03-23 at 19.49.13

Hi there @dev2 :wave: - Thanks for reaching out!

I have a hunch that this could be due to your channel saying ‘Push’ even though it should be configured as an SMS channel. Try setting AWS SNS as a standalone channel instead of ‘Push’ so it looks like the bottom screenshot.

The current routing strategy you have is correct and should send to the best of either channel if the first one fails because of an incomplete profile. Are you getting a response from AWS SNS that the recipient number is unverified?

Screen Shot 2023-03-23 at 3.33.57 PM

I think you are right! I have adjusted the channels to use the specific providers instead of generic channels. Thanks!