PushTicket similar to PushReceipt

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): all

Hello,

Handling the notifications errors may become cumbersome due to the differences between the documentation, forums, and the actual returned values.

A similar post can be found here, but without an answer: DeviceNotRegistered in push receipt vs ticket

Both the ‘expo-server-sdk’ types and the above post are excluding the ID from the response for error ones (ExpoPushErrorTicket), but it’s actually returned by “sendPushNotificationsAsync” even when there is an error. Should we trust the ID to correlate with receipts?
From the 'expo-server-sdk" docs:

NOTE: Not all tickets have IDs; for example, tickets for notifications
that could not be enqueued will have error information and no receipt ID

This is what is get after calling sendPushNotificationsAsync

TicketChunk [
  {
    id: '29d59e61-a783-4c92-9fd0-dbcc96daa3f1',
    status: 'error',
    message: 'The recipient device is not registered with FCM.',
    details: { error: 'DeviceNotRegistered', fault: 'developer' }
  },
  { status: 'ok', id: '6c45a613-7aeb-4d8a-a3bf-a4470ed35e51' },
  {
    id: 'f20fe600-8a93-45ca-ae57-1751cbfb2c96',
    status: 'error',
    message: 'The recipient device is not registered with FCM.',
    details: { error: 'DeviceNotRegistered', fault: 'developer' }
  },
  { id: 'e1554ea6-0176-4d14-b677-28b461524211', status: 'ok' }
]
  1. Should we immediately handle the errored ones as we already know the “DeviceNotRegistered” error?
  2. Should we request all receipts? There may be a different response?

Also, the receipts are almost identical to the tickets.

{
  "12441c47-7e07-4121-96a1-1a0d029a8fdd": {
    "status": "error",
    "message": "The recipient device is not registered with FCM.",
    "details": {
      "fault": "developer",
      "error": "DeviceNotRegistered",
      "sentAt": 1624965547
    },
    "__debug": {}
  },
  "2e0bbeee-04e7-409d-ba8f-dc36b9acf025": {
    "status": "ok"
  },
  "55cb08b8-9cc9-4088-bc5f-4c24de235d8c": {
    "status": "ok"
  },
  "914dad6c-ed8e-4219-990c-3c0fa7dd02f0": {
    "status": "error",
    "message": "The recipient device is not registered with FCM.",
    "details": {
      "fault": "developer",
      "error": "DeviceNotRegistered",
      "sentAt": 1624965547
    },
    "__debug": {}
  }
}

Thanks!

Keep it alive, maybe will help someday :slight_smile:

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