@@ -74,49 +74,49 @@ const App = () => {
7474 const colorScheme = useColorScheme ( ) ;
7575 // const streamChatTheme = useStreamChatTheme();
7676
77- useEffect ( ( ) => {
78- const messaging = getMessaging ( ) ;
79- const unsubscribeOnNotificationOpen = messaging . onNotificationOpenedApp ( ( remoteMessage ) => {
80- // Notification caused app to open from background state on iOS
81- const channelId = remoteMessage . data ?. channel_id as string ;
82- if ( channelId ) {
83- navigateToChannel ( channelId ) ;
84- }
85- } ) ;
86- // handle notification clicks on foreground
87- const unsubscribeForegroundEvent = notifee . onForegroundEvent ( ( { detail, type } ) => {
88- if ( type === EventType . PRESS ) {
89- // user has pressed the foreground notification
90- const channelId = detail . notification ?. data ?. channel_id as string ;
91- if ( channelId ) {
92- navigateToChannel ( channelId ) ;
93- }
94- }
95- } ) ;
96- notifee . getInitialNotification ( ) . then ( ( initialNotification ) => {
97- if ( initialNotification ) {
98- // Notification caused app to open from quit state on Android
99- const channelId = initialNotification . notification . data ?. channel_id as string ;
100- if ( channelId ) {
101- initialChannelIdGlobalRef . current = channelId ;
102- }
103- }
104- } ) ;
105- messaging . getInitialNotification ( ) . then ( ( remoteMessage ) => {
106- if ( remoteMessage ) {
107- // Notification caused app to open from quit state on iOS
108- const channelId = remoteMessage . data ?. channel_id as string ;
109- if ( channelId ) {
110- // this will make the app to start with the channel screen with this channel id
111- initialChannelIdGlobalRef . current = channelId ;
112- }
113- }
114- } ) ;
115- return ( ) => {
116- unsubscribeOnNotificationOpen ( ) ;
117- unsubscribeForegroundEvent ( ) ;
118- } ;
119- } , [ ] ) ;
77+ // useEffect(() => {
78+ // const messaging = getMessaging();
79+ // const unsubscribeOnNotificationOpen = messaging.onNotificationOpenedApp((remoteMessage) => {
80+ // // Notification caused app to open from background state on iOS
81+ // const channelId = remoteMessage.data?.channel_id as string;
82+ // if (channelId) {
83+ // navigateToChannel(channelId);
84+ // }
85+ // });
86+ // // handle notification clicks on foreground
87+ // const unsubscribeForegroundEvent = notifee.onForegroundEvent(({ detail, type }) => {
88+ // if (type === EventType.PRESS) {
89+ // // user has pressed the foreground notification
90+ // const channelId = detail.notification?.data?.channel_id as string;
91+ // if (channelId) {
92+ // navigateToChannel(channelId);
93+ // }
94+ // }
95+ // });
96+ // notifee.getInitialNotification().then((initialNotification) => {
97+ // if (initialNotification) {
98+ // // Notification caused app to open from quit state on Android
99+ // const channelId = initialNotification.notification.data?.channel_id as string;
100+ // if (channelId) {
101+ // initialChannelIdGlobalRef.current = channelId;
102+ // }
103+ // }
104+ // });
105+ // messaging.getInitialNotification().then((remoteMessage) => {
106+ // if (remoteMessage) {
107+ // // Notification caused app to open from quit state on iOS
108+ // const channelId = remoteMessage.data?.channel_id as string;
109+ // if (channelId) {
110+ // // this will make the app to start with the channel screen with this channel id
111+ // initialChannelIdGlobalRef.current = channelId;
112+ // }
113+ // }
114+ // });
115+ // return () => {
116+ // unsubscribeOnNotificationOpen();
117+ // unsubscribeForegroundEvent();
118+ // };
119+ // }, []);
120120
121121 return (
122122 < SafeAreaProvider
@@ -177,7 +177,6 @@ const DrawerNavigatorWrapper: React.FC<{
177177 < OverlayProvider bottomInset = { bottom } value = { { style : streamChatTheme } } >
178178 < Chat
179179 client = { chatClient }
180- enableOfflineSupport
181180 // @ts -expect-error - the `ImageComponent` prop is generic, meaning we can expect an error
182181 ImageComponent = { FastImage }
183182 isMessageAIGenerated = { isMessageAIGenerated }
0 commit comments