如何设置为 0 通知计数 android firebase
How to set to 0 notification count android firebase
如何在打开应用程序后使用 firebase 将通知计数设置为 0 android?
是否有任何等同于swift的applicationDidBecomeActive
UIApplication.shared.applicationIconBadgeNumber = 0
?
谢谢!
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();
}
如何在打开应用程序后使用 firebase 将通知计数设置为 0 android?
是否有任何等同于swift的applicationDidBecomeActive
UIApplication.shared.applicationIconBadgeNumber = 0
?
谢谢!
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();
}