Tagir Ahmad:
¿Cómo se pone a 0 el recuento de notificación de Android con base de fuego después de abrir la aplicación?
¿Hay alguna equivalente de Swift de la applicationDidBecomeActive
UIApplication.shared.applicationIconBadgeNumber = 0
?
¡Gracias!
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();
}