exponent-server-sdk-golang
exponent-server-sdk-golang copied to clipboard
Add support for multiple recipients: Error when multiple receivers but only one data
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: https://github.com/oliveroneill/exponent-server-sdk-golang/blob/266e8e6ee5ad108d87b4ca0bfd775345862e8eba/sdk/push_client.go#L121
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.
Good catch! Feel free to make a pull request
Hi, I am still getting the same error message when trying to use more recipients.