Philipp Otto
Philipp Otto

Reputation: 4111

Firebase Cloud Messaging: Why do registration tokens get deleted?

In our app we use Firebase Cloud Messaging to send push notifications to our users. We save the registration tokens of our users in our SQL database and when a user logs in or out we use the Firebase API to manage his topic subscriptions.

This works out pretty well in most of the cases but now the topic subscriptions return the following error for some of our registration tokens:

The provided registration token is not registered. A previously valid registration token can be unregistered for a variety of reasons. See the error documentation for more details. Remove this registration token and stop using it to send messages

In which cases does Firebase delete previously registered registration tokens? I can not find any specific information about this in the error documentation.

Thanks for your help!

Upvotes: 4

Views: 2369

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317352

From the documentation:

A previously valid registration token can be unregistered for a variety of reasons, including:

  • The client app unregistered itself from FCM.
  • The client app was automatically unregistered. This can happen if the user uninstalls the application or, on iOS, if the APNS Feedback Service reported the APNS token as invalid.
  • The registration token expired. For example, Google might decide to refresh registration tokens or the APNS token may have expired for iOS devices.
  • The client app was updated, but the new version is not configured to receive messages.

Upvotes: 4

Related Questions