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.
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.
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.
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).
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.
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.
I can conclude after researching this problem that when an emulator runs the app Firebase will return BLACKLISTED. Also thanks to @kR105
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With