From c3cd9fa7013e3e3d96d503d2c040af8f8973d711 Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Thu, 5 Oct 2023 15:11:42 -0300 Subject: [PATCH] chore: dispatch notification on app opening --- app/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/index.tsx b/app/index.tsx index 0f02cc04f..f572c4a8c 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -5,9 +5,10 @@ import RNScreens from 'react-native-screens'; import { Provider } from 'react-redux'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import Orientation from 'react-native-orientation-locker'; +import notifee from '@notifee/react-native'; import { appInit, appInitLocalSettings, setMasterDetail as setMasterDetailAction } from './actions/app'; -import { deepLinkingOpen } from './actions/deepLinking'; +import { deepLinkingClickCallPush, deepLinkingOpen } from './actions/deepLinking'; import AppContainer from './AppContainer'; import { ActionSheetProvider } from './containers/ActionSheet'; import InAppNotification from './containers/InAppNotification'; @@ -135,6 +136,11 @@ export default class Root extends React.Component<{}, IState> { return; } + const initialNotification = await notifee.getInitialNotification(); + if (initialNotification?.notification?.data?.notificationType === 'videoconf') { + store.dispatch(deepLinkingClickCallPush(initialNotification?.notification?.data)); + } + // Open app from deep linking const deepLinking = await Linking.getInitialURL(); const parsedDeepLinkingURL = parseDeepLinking(deepLinking!);