Resolved! FirebaseInstanceIdService is deprecated

So after updating the version of firebase-messaging in the build.gradle file from v17.0.0 to v17.1.0, strange things started happening…

there was a line of horror in service I used to use for messaging in my application. After some research, I landed on this page.

Let’s quickly go to updates which we need to do to get it working like before.

Now there is no need of FirebaseInstanceIdService to get token, so just delete it and also remove it from AndroidManifest.xml as well.

Method onTokenRefresh() is depriciated. Now we need to override onNewToken() method to get new token.

 

Method getToken() which we used in Activity is also depriciated now. Use getInstanceId() as follow

 

I hope this will help in time of crises 😛

Leave a Reply

Your email address will not be published. Required fields are marked *