Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NotRegistered Response from FCM even when the app is installed on a users mobile device

We just migrated from GCM to FCM. For tracking uninstalls we send a silent notification to all our users and if we get a "NotRegistered" response we treat the user as uninstalled. Since the last few days, we started getting "NotRegistered" for some of the users who have not uninstalled the app.

On querying the FCM diagnostics for the same Registration token the messages are being delivered but they are continuously in accepted state.Attached is the screenshot. The error code I received while sending the message is still "NotRegistered" . The user has not uninstalled the app.Attached is the screenshot.

We are getting "Not Registered" since 1st of June while messages are in accepted state till 4th of June. This image shows message Ids of notifications sent till 4th of June:

1

Would like a clarification on the following:

  1. Why did the status of the FCM registration token change to NotRegistered. There was no upgrade since the last month and the user has been using the latest version since a long time?

  2. Is checking FCM error code "NotRegistered" a full proof way to track uninstalls? Are there better mechanisms available?

like image 456
karan Avatar asked Jun 05 '17 15:06

karan


People also ask

Can FCM notification on Android overwrite previous one?

If specified and a notification with the same tag is already being shown, the new notification replaces the existing one in the notification drawer.

How does FCM push notification work?

The FCM backend receives the message request, generates a message ID and other metadata, and sends it to the platform specific transport layer. When the device is online, the message is sent via the platform-specific transport layer to the device. On the device, the client app receives the message or notification.

What is difference between APNs and FCM?

APNs needs to be used for push messaging when an application is in the background. Hence, FCM uses APNs to deliver messages when the message contains user visible payload, e.g., body, sound etc. FCM also delivers via APNs when content available is set.


1 Answers

  1. Reasons as to why a NotRegistered happens are stated in the docs, the third one, being a probable reason for your case (emphasis mine):

    An existing registration token may cease to be valid in a number of scenarios, including:

    • If the client app unregisters with FCM.
    • If the client app is automatically unregistered, which can happen if the user uninstalls the application. For example, on iOS, if the APNS Feedback Service reported the APNS token as invalid.
    • If the registration token expires (for example, Google might decide to refresh registration tokens, or the APNS token has expired for iOS devices).
    • If the client app is updated but the new version is not configured to receive messages.

    For all these cases, remove this registration token from the app server and stop using it to send messages.

  2. Nope. As I linked above, the NotRegistered error doesn't only trigger during uninstalls. AFAIK, there is no standard way of doing this. Have a look at some of these posts.

like image 89
AL. Avatar answered Sep 20 '22 18:09

AL.