0

The problem is, I wanted to use Firebase cloud messaging in my chat app. Implementing the firebase documents in my android studio, I need to create a class which extends the FirebaseInstanceIdService. However, this service seems missing.

 public class MyFirebaseInstanceIdService extends  FirebaseInstanceIdService{
 }
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
EngineerDanny
  • 795
  • 1
  • 9
  • 13

1 Answers1

2

Yes, FirebaseInstanceIdService is deprecated in the new version. Now you can get the updated token in MyFirebaseMessagingService.

In MyFirebaseMessagingService new method is introduced for the updated token if in case it expired.

override fun onNewToken(token: String?) {
    Log.d(TAG, "Refreshed token: $token")

    // If you want to send messages to this application instance or
    // manage this apps subscriptions on the server side, send the
    // Instance ID token to your app server.
    sendRegistrationToServer(token)
}

For the more details please visit fcm

Sunny
  • 3,134
  • 1
  • 17
  • 31