Context:
Implementing Cloud Push Notifications on Android via Parse Server
as Backend and Firebase Cloud
Messaging Service
Just to add to Md. Asaduzzaman's answer, make sure to override the onNewToken() method in your custom FirebaseMessagingService, like in this tutorial. (I just found the tutorial and thought it would be nice to share it if others are stuck with the same problem).
@Override
public void onNewToken(String s) {
super.onNewToken(s);
Log.i("NEW_TOKEN", s);
}
We need to override it because:
"FirebaseInstanceIdService: This class was deprecated. In favour of overriding onNewToken in FirebaseMessagingService.
Once that has been implemented, this service can be safely removed."