简体   繁体   中英

FirebaseInstanceId.getInstance().deleteInstanceId(); throw java.io.IOException: SERVICE_NOT_AVAILABLE in offline

I want to unsubscribe from firebase push notification when user logout from application.

For it I use FirebaseInstanceId.getInstance().deleteInstanceId();

It works when the device have internet connection. If the device does not have internet connection "java.io.IOException: SERVICE_NOT_AVAILABLE" is occurred.

How correct unsubscribe from push notification if device doesn't have internet connection ?

From the Firebase documentation :

To unsubscribe, the client app calls Firebase Cloud Messaging unsubscribeFromTopic() with the topic name.

If there is no internet connection, this will queue up the unsubscribe until the client is connected again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM