diff --git a/native/push/reducer.js b/native/push/reducer.js --- a/native/push/reducer.js +++ b/native/push/reducer.js @@ -1,5 +1,7 @@ // @flow +import { NativeModules } from 'react-native'; + import { logOutActionTypes, deleteAccountActionTypes, @@ -12,7 +14,6 @@ rescindAndroidNotificationActionType, type Action, } from '../redux/action-types'; -import { getFirebase } from './firebase'; type RecordAndroidNotificationPayload = { +threadID: string, @@ -59,14 +60,9 @@ [action.payload.threadID]: [...set], }; } else if (action.type === clearAndroidNotificationsActionType) { - if (!state[action.payload.threadID]) { - return state; - } - for (const notifID of state[action.payload.threadID]) { - getFirebase() - .notifications() - .android.removeDeliveredNotificationsByTag(notifID); - } + NativeModules.CommAndroidNotifications.removeAllActiveNotificationsForThread( + action.payload.threadID, + ); return { ...state, [action.payload.threadID]: [],