How can I update this deprecated code for FirebaseInstanceId?

  android-studio, firebase, java, token

So I have this code and is deprecated and I don’t know how to update it.
I would really appreciate it if you help me.

FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(task -> {
        if (task.isSuccessful() && task.getResult() != null) {
            sendFCMTokenDatabase(task.getResult().getToken());
        }
    });

Source: Android Studio Questions

LEAVE A COMMENT