aboutsummaryrefslogtreecommitdiff
path: root/src/routes/Routes.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-02-05 17:35:05 -0500
committerIvan Chen <ivan@tagg.id>2021-02-05 17:35:05 -0500
commit231fed8c645dc29334b946dccca94fbb13116fe2 (patch)
treefc7bcd0f9e11b943d89877c621e95681e89a18d7 /src/routes/Routes.tsx
parenta5f746525df9bb2967c252b70e7a4e2f9daa2b8d (diff)
parentbad7fac394f8ef2870a9a139fd46d0def4421bf1 (diff)
Merge branch 'master' into TMA-579-Redesign-Snapchat-Tiktok
# Conflicts: # src/components/common/TaggSquareButton.tsx
Diffstat (limited to 'src/routes/Routes.tsx')
-rw-r--r--src/routes/Routes.tsx8
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 />;
};