1

I am using the below-mentioned code to fetch the FCM registration token, but when I reinstall the app the token doesn't generate and giving the error java.util.concurrent.ExecutionException: java.io.IOException: SERVICE_NOT_AVAILABLE

Please help.

FirebaseMessaging.getInstance().getToken()
                .addOnCompleteListener(new OnCompleteListener<String>() {
                    @Override
                    public void onComplete(@NonNull Task<String> task) {
                        if (!task.isSuccessful()) {
                            Log.w("TAG", "Fetching FCM token failed", task.getException());
                            return;
                        }
                        fcmToken = task.getResult();
                    }
                });
  • Does this answer your question? [Android: FCM java.io.IOException: SERVICE\_NOT\_AVAILABLE error on some devices](https://stackoverflow.com/questions/50208426/android-fcm-java-io-ioexception-service-not-available-error-on-some-devices) – bluetoothfx Jun 27 '21 at 08:26

0 Answers0