diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-23 17:40:24 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-23 17:40:24 -0400 |
commit | 4ce89289547bea0914a98b8307f4539464281f96 (patch) | |
tree | 04e6a12606e679018bc62dcf607b35b43a609fdd /src | |
parent | fc6e1452bb615e6d2cdf9a3cf812931aa34054e7 (diff) |
added logic to navigate on notification opened
Diffstat (limited to 'src')
-rw-r--r-- | src/services/FCMService.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/services/FCMService.ts b/src/services/FCMService.ts index 711483ec..f76e94b6 100644 --- a/src/services/FCMService.ts +++ b/src/services/FCMService.ts @@ -135,12 +135,11 @@ class FCMService { // Called when app is opened from backrground state messaging().onNotificationOpenedApp((remoteMessage) => { if (remoteMessage) { - // TODO: Get {name, params} of screen when user must be redirected to - // Redirected to Notification Screen for now - const redirectTo = 'Notifications'; - /* TODO: Check login status and redirect user/store screen to async as - initialRoute for NavigationBar Stack */ - RootNavigation.navigate(redirectTo); + if (remoteMessage.category === 'CHAT') { + RootNavigation.navigate('ChatList'); + } else { + RootNavigation.navigate('Notifications'); + } } }); |