Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple recipients: Error when multiple receivers but only one data #12

Open
Zarathustra2 opened this issue Jul 11, 2020 · 2 comments · Fixed by nathancoleman/exponent-server-sdk-golang#2 · May be fixed by #18

Comments

@Zarathustra2
Copy link

I get this error:

Mismatched response length. Expected 1 receipts but only received 3 

This happens when I send an expo message with 3 receivers. I think after #10 got merged it has been forgotten to update these lines:

if len(messages) != len(r.Data) {

Since the expo api will return something like this for a single message:

{
  "data": [
    {
      "status": "error",
      "message": "\"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]\" is not a registered push notification recipient",
      "details": {
        "error": "DeviceNotRegistered"
      }
    },
    {
      "status": "ok",
      "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    }
  ]
}

So per a single message the data will be as large as the amount of tokens used.

@oliveroneill
Copy link
Owner

Good catch! Feel free to make a pull request

@nikolal
Copy link

nikolal commented Jan 12, 2021

Hi, I am still getting the same error message when trying to use more recipients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants