How to set to 0 notification count android firebase

Tagir Ahmad :

How to set to 0 notification count android using firebase after opening the app?

Is there any equivalent of swift's applicationDidBecomeActive

UIApplication.shared.applicationIconBadgeNumber = 0 ?

Thank you!

Vidor Vistrom :
import android.app.NotificationManager;
import android.content.Context;

@Override
protected void onResume() {
    super.onResume();

    // Removing All Notifications
    cancelAllNotifications();
}

private void cancelAllNotifications() {
    NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancelAll();
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=357411&siteId=1