Firebaseinstanceidservice Is Deprecated

FirebaseInstanceIdService is deprecated

firebaser here

Check the reference documentation for FirebaseInstanceIdService:

This class was deprecated.

In favour of overriding onNewToken in FirebaseMessagingService. Once that has been implemented, this service can be safely removed.

Weirdly enough the JavaDoc for FirebaseMessagingService doesn't mention the onNewToken method yet. It looks like not all updated documentation has been published yet. I've filed an internal issue to get the updates to the reference docs published, and to get the samples in the guide updated too.

In the meantime both the old/deprecated calls, and the new ones should work. If you're having trouble with either, post the code and I'll have a look.

What is an alternative to the deprecated FirebaseInstanceIdService and OnTokenRefresh?

as FirebaseInstanceId is depreciated you could use

  FirebaseMessaging.getInstance().getToken().addOnCompleteListener(task -> {
System.out.println("Token : "+ task.getResult());
});

Warning CS0618: 'FirebaseInstanceIdService' is obsolete: 'This class is obsoleted in this android platform

When you update to Xamarin.Firebase.Messaging version 71.1740.0 then you start to get compiler warnings about deprecated methods due to changes in the Google libraries. You no longer need FirebaseInstanceIdService so go ahead and remove that. Now you get the device token from your FirebaseMessagingService.OnNewToken method.



Related Topics



Leave a reply



Submit