diff --git a/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java b/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java --- a/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java +++ b/native/android/app/src/main/java/app/comm/android/notifications/CommAndroidNotifications.java @@ -85,6 +85,11 @@ } } + @ReactMethod + public void removeAllDeliveredNotifications() { + notificationManager.cancelAll(); + } + @Override public Map getConstants() { final Map constants = new HashMap<>(); diff --git a/native/push/android.js b/native/push/android.js --- a/native/push/android.js +++ b/native/push/android.js @@ -10,6 +10,7 @@ +createChannel: (channelID: string, name: string, importance: number) => void, +getConstants: () => { NOTIFICATIONS_IMPORTANCE_HIGH: number, ... }, +setBadge: (count: number) => void, + +removeAllDeliveredNotifications: () => void, ... }; export type AndroidForegroundMessage = { diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js --- a/native/push/push-handler.react.js +++ b/native/push/push-handler.react.js @@ -270,7 +270,7 @@ if (Platform.OS === 'ios') { NotificationsIOS.removeAllDeliveredNotifications(); } else if (Platform.OS === 'android') { - getFirebase().notifications().removeAllDeliveredNotifications(); + CommAndroidNotifications.removeAllDeliveredNotifications(); } }