Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

[Feature Request] Improve DeviceNotRegistered Error handling #4

Open
Bryksin opened this issue Apr 10, 2020 · 0 comments · May be fixed by #7
Open

[Feature Request] Improve DeviceNotRegistered Error handling #4

Bryksin opened this issue Apr 10, 2020 · 0 comments · May be fixed by #7

Comments

@Bryksin
Copy link

Bryksin commented Apr 10, 2020

Hi

As stated in the master example we create a list of recipient tokens, generate a message for each receiver token and then send all those messages in one scope.

However, in response, we can get errors per each sent message, where one of them could be DeviceNotRegistered if the receiver somehow managed to opt-out from Expo, and our stored token no longer valid.
In that case, logically, I would have to delete such outdated token from my DB, however, at the moment it is not possible to match that specific error to initial list of tokens we build at the beginning

I had to dig through Expo API documentation and find out, that they are also not returning this token in a nice format as K, V entry, however, I spot that token itself present in the error string message:

{
  "data": [
    {
      "status": "error",
      "message": "\"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]\" is not a registered push notification recipient",
      "details": {
      "error": "DeviceNotRegistered"
    }
  ]
}

So as a feature I would like to request to parse it nicely at the library SDK end, and provide nice method getInvalidToken() so that parsing functionality will be part of SDK, rather then each one will have own implementation of error string parse

P.S. I also opened a ticket with Expo to include the token as an individual field in the response.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant