[Android] Add the ability to remove notifications based on the tag

This commit is contained in:
David Gruseck
2018-05-07 17:35:10 +02:00
parent 19b226b048
commit 89806d97f7
8 changed files with 68 additions and 5 deletions

View File

@@ -112,6 +112,11 @@ public class RNFirebaseNotifications extends ReactContextBaseJavaModule implemen
notificationManager.removeDeliveredNotification(notificationId, promise);
}
@ReactMethod
public void removeDeliveredNotificationsByTag(String tag, Promise promise) {
notificationManager.removeDeliveredNotificationsByTag(tag, promise);
}
@ReactMethod
public void setBadge(int badge, Promise promise) {
// Store the badge count for later retrieval
@@ -284,6 +289,7 @@ public class RNFirebaseNotifications extends ReactContextBaseJavaModule implemen
}
if (notification.getTag() != null) {
androidMap.putString("group", notification.getTag());
androidMap.putString("tag", notification.getTag());
}
notificationMap.putMap("android", androidMap);