FirebaseInstanceId.getInstance().deleteInstanceId() doesn't work offline

Viewed 446

I am trying to delete FirebaseInstanceId when user logs out. It works fine when user is online. But it gives Exception error when user is offline. Should I schedule it for handling when user is online?

        FirebaseMessaging.getInstance().setAutoInitEnabled(false);
        new Thread() {
            @Override
            public void run() {
                try {
                   FirebaseInstanceId.getInstance().deleteInstanceId();
                } catch (IOException e) {
                    Log.e("FCMERROR",e.getLocalizedMessage());
                }
            }
        }.start();

It throws single line Exception

java.net.UnknownHostException: Unable to resolve host "firebaseinstallations.googleapis.com": No address associated with hostname
0 Answers
Related