diff options
| author | Ivan Chen <ivan@thetaggid.com> | 2021-02-05 16:47:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-05 16:47:17 -0500 |
| commit | ed866c9304a4996c4cdfb19224b7ea26c2ee7e32 (patch) | |
| tree | d05e9e2a48dbc6d9986add1e36ba32ded9699b32 /src/routes/Routes.tsx | |
| parent | c3cd8f95c6534fb5eb78af299ef424c50aefd85a (diff) | |
| parent | 94d38350ba0bcfd0bc3095d8628de67fbe6ee6dc (diff) | |
Merge pull request #221 from IvanIFChen/tma607-notification-permission-after-onboarding
[TMA-607] Moved Permission to After Login
Diffstat (limited to 'src/routes/Routes.tsx')
| -rw-r--r-- | src/routes/Routes.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/routes/Routes.tsx b/src/routes/Routes.tsx index a14f1576..a5383a47 100644 --- a/src/routes/Routes.tsx +++ b/src/routes/Routes.tsx @@ -7,6 +7,7 @@ import {userLogin} from '../utils'; import SplashScreen from 'react-native-splash-screen'; import messaging from '@react-native-firebase/messaging'; import {updateNewNotificationReceived} from '../store/actions'; +import {fcmService} from '../services'; const Routes: React.FC = () => { const { @@ -39,6 +40,13 @@ const Routes: React.FC = () => { } }, [dispatch, userId]); + useEffect(() => { + if (userId) { + fcmService.setUpPushNotifications(); + fcmService.sendFcmTokenToServer(); + } + }); + return userId ? <NavigationBar /> : <Onboarding />; }; |
