aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/Routes.tsx8
-rw-r--r--src/routes/main/MainStackNavigator.tsx1
2 files changed, 9 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 />;
};
diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx
index e038d2c2..74993af9 100644
--- a/src/routes/main/MainStackNavigator.tsx
+++ b/src/routes/main/MainStackNavigator.tsx
@@ -40,6 +40,7 @@ export type MainStackParams = {
moment_id: string;
userXId: string | undefined;
screenType: ScreenType;
+ comment_id?: string;
};
FriendsListScreen: {
userXId: string | undefined;