FCM Android Push Notification Error 'DeviceNotRegistered'

Most push notifications go through fine, but I see bunch of errors like this:

There was an error sending a notification: The recipient device is not registered with FCM.

{ fault: 'developer',
  error: 'DeviceNotRegistered',
  sentAt: 1553386214 }

Is this something I need to fix? How come I don’t get the device’s expo token in the error message?

Thank you

Hey @qappanon,

This was actually asked about recently, you can see the discussion here!
Let me know if that helps :slight_smile:

In the future, I recommend searching first for similar issues before posting, it just means a quicker fix for you!

I saw the other thread. I am seeing the same issue, but this is a brand new app uploaded to google play store with FCM enabled. How come I see the errors if so?

{ fault: 'developer',
  error: 'DeviceNotRegistered',
  sentAt: 1553637311 }
{ 'xxxx-xxxx-xx-xxx-xx':
   { status: 'error',
     message: 'The recipient device is not registered with FCM.',
     details:
      { fault: 'developer',
        error: 'DeviceNotRegistered',
        sentAt: 1553634319 },
     __debug: {} } }

Ah okay, gotchya.

If you look through the Notification docs, you’ll see that that error code- DeviceNotRegistered indicates that the device can’t receive Push Notifications anymore (It can be disabled / unregistered for several reasons such as users disabling push notifications or uninstalling the app).

1 Like

OK, I’ll remove the push tokens that are failing. I’m sending the notification in chunks as per the guide, but how can I track the push token ID? The api does tell me which token the response message corresponds to.

Example chunk:

[ { to: 'ExponentPushToken[xxxxx]',
    sound: 'default',
    title: 'Testing',
    body: 'Developer Test Notification',
    ttl: 2419200,
    badge: 1,
    priority: 'high',
    channelId: 'xxxx' } ]

API response (expo.sendPushNotificationsAsync):

[ { id: 'xxx-xxx-xx-xxxxx', status: 'ok' } ]

The receipt also does not tell me the push token ID having problems.

{ 'xxxx-xx-xx-x-xx-xxxx':
   { status: 'error',
     message: 'The recipient device is not registered with FCM.',
     details:
      { fault: 'developer',
        error: 'DeviceNotRegistered',
        sentAt: 1553627121 },
     __debug: {} } }

Thanks

Charlie, any help is appreciated. Thank you!

Have you already checked your Firebase Console?

Checked it for what? Here’s a screenshot of the dashboard.

Oh sorry, I misread your question.

I think I’m still a little confused, the Push Token you stop sending notifications to is the one listed in the chunk. The Notifications docs state

Upon success, the HTTP response will be a JSON object whose data field is an array of push tickets , each of which corresponds to the message at its respective index in the request

So if you’re sending as an array, the indexes of the request/response correspond.

1 Like

Got it. Thank you!

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