diff options
| author | Ashm Walia <ashmwalia@outlook.com> | 2021-01-19 11:36:56 -0800 |
|---|---|---|
| committer | Ashm Walia <ashmwalia@outlook.com> | 2021-01-19 11:36:56 -0800 |
| commit | c510ba308738fc88edb11772fe9db6ec4537427f (patch) | |
| tree | 86ca27286d50c35ec9a4b6362c8b42408ac85160 /src/routes/Routes.tsx | |
| parent | bb885ff561e44e23f9fb27ba8aa18f4dce8c690e (diff) | |
Done
Diffstat (limited to 'src/routes/Routes.tsx')
| -rw-r--r-- | src/routes/Routes.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/routes/Routes.tsx b/src/routes/Routes.tsx index 38a987f7..a14f1576 100644 --- a/src/routes/Routes.tsx +++ b/src/routes/Routes.tsx @@ -5,6 +5,8 @@ import {useSelector, useDispatch} from 'react-redux'; import {RootState} from '../store/rootReducer'; import {userLogin} from '../utils'; import SplashScreen from 'react-native-splash-screen'; +import messaging from '@react-native-firebase/messaging'; +import {updateNewNotificationReceived} from '../store/actions'; const Routes: React.FC = () => { const { @@ -24,7 +26,12 @@ const Routes: React.FC = () => { * SplashScreen is the actual react-native's splash screen. * We can hide / show it depending on our application needs. */ + useEffect(() => { + messaging().onMessage(() => { + dispatch(updateNewNotificationReceived(true)); + }); + if (!userId) { userLogin(dispatch, {userId: '', username: ''}); } else { |
