Push Notification Failure Identificiation

Hey There! I did not know where to ask, if there is a better please let me know!

Background
The intention, behind these questions, is to handle the errors in the docs:

  • DeviceNotRegistered : the device cannot receive push notifications anymore and you should stop sending messages to the corresponding Expo push token.

  • MessageRateExceeded : you are sending messages too frequently to the given device. Implement exponential backoff and slowly retry sending messages.

https://docs.expo.io/versions/latest/guides/push-notifications/

Question 1: How does one associate the error to a specific notification object?

For example assuming the following notification object is sent:

Notification Object Example:

[{"to":"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]","title":"Test","body":"test","sound":"default"}, ...]

The response could be:

Ticket Example:

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

Question 2: Is the data id of the receipt the same id as the token?

Receipt Example:

{
  "data": {
    "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX": {
      "status": "error",
      "message": "The Apple Push Notification service failed to send the notification",
      "details": {
        "error": "DeviceNotRegistered"
      }
    },
    "YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY": {
      "status": "ok"
    }
  }
}

Question 3: How does one associate the receipt failure to a specific token?

Seriously, thank you for your time!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.