Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does firebase push_token return Blacklisted?

Tags:

I am implementing Firebase messaging in my app.

While I am testing the app sends the refreshed_token to my database, but in live production environment (Play store) it returns 'BLACKLISTED' as push_token.

Does someone know why this happen? Or what I can do to fix this problem. Can't find others with the same problem.

I use the code from the Firebase documentation.

@Override
public void onTokenRefresh() {
    super.onTokenRefresh();
    String refreshedToken = FirebaseInstanceId.getInstance().getToken();
    Log.d(TAG, "Refreshed token: " + refreshedToken);
    sendTokenToServer(refreshedToken);
}

The sendTokenToServer method posts the token to my api and inserts in the database.

like image 834
sj0rske Avatar asked Feb 09 '17 11:02

sj0rske


People also ask

What is Registration_ids in FCM?

The registration_ids parameter refers to the Registration Tokens you want to add in that specific Device Group. Described as: An ID generated by the FCM SDK for each client app instance. Required for single device and device group messaging. Note that registration tokens must be kept secret.

What is collapse key in firebase?

FCM allows a maximum of four different collapse keys per device to be used by the app server at any given time. In other words, the FCM connection server can simultaneously store four different collapsible send-to-sync messages per device, each with a different collapse key.

How can I get device registration token in firebase?

This requires you to: Add app logic in your client app to retrieve the current token using the appropriate API call (such as token(completion): for Apple platforms or getToken() for Android) and then send the current token to your app server for storage (with timestamp).

Does FCM token change?

Similarly to how GCM works, the FCM token can change due to token-rotation. Note: the token rotation is a rare-event. Don't expect to see it often. But still, if you care about the token you should implement onTokenRefresh() to be informed of changes.


2 Answers

from Firebase support:

Hi there,

It seems that this is a known minor issue with our internal infrastructure where the device used for the Play Store review can be BLACKLISTED by GCM / FCM in some occasions. However, this should not affect your real users. We are looking beyond Firebase and working with Play Store team to avoid this inconvenience.

like image 168
juan Luis Avatar answered Sep 22 '22 14:09

juan Luis


I can conclude after researching this problem that when an emulator runs the app Firebase will return BLACKLISTED. Also thanks to @kR105

like image 23
sj0rske Avatar answered Sep 22 '22 14:09

sj0rske