diff --git a/apps/tlon-mobile/src/App.tsx b/apps/tlon-mobile/src/App.tsx index 871c0bddac..97784fc3e4 100644 --- a/apps/tlon-mobile/src/App.tsx +++ b/apps/tlon-mobile/src/App.tsx @@ -6,8 +6,6 @@ import { } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { TamaguiProvider } from '@tloncorp/ui'; -import type { Subscription } from 'expo-notifications'; -import { addNotificationResponseReceivedListener } from 'expo-notifications'; import { PostHogProvider } from 'posthog-react-native'; import { useEffect, useState } from 'react'; import { StatusBar, Text, View } from 'react-native'; @@ -58,22 +56,9 @@ const App = ({ wer }: Props) => { const screenOptions = useScreenOptions(); useEffect(() => { - let notificationTapListener: Subscription | undefined; if (isAuthenticated) { - // Start notification tap listener - // This only seems to get triggered on iOS. Android handles the tap and other intents in native code. - notificationTapListener = addNotificationResponseReceivedListener( - handleNotificationResponse - ); - - connectNotifications(); syncContacts(); } - - return () => { - // Clean up listeners - notificationTapListener?.remove(); - }; }, [isAuthenticated]); useEffect(() => { diff --git a/apps/tlon-mobile/src/utils/notifications.ts b/apps/tlon-mobile/src/utils/notifications.ts deleted file mode 100644 index d5aa3d9955..0000000000 --- a/apps/tlon-mobile/src/utils/notifications.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { NotificationResponse } from 'expo-notifications'; - -import { markChatRead } from '../lib/chatApi'; - -export const handleNotificationResponse = (response: NotificationResponse) => { - const { - actionIdentifier, - userText, - notification: { - request: { - content: { data }, - }, - }, - } = response; - if (actionIdentifier === 'markAsRead' && data.channelId) { - markChatRead(data.channelId); - } else if (actionIdentifier === 'reply' && userText) { - // Send reply - } else if (data.wer) { - // TODO: handle wer - // setUri((curr) => ({ - // ...curr, - // uri: createUri(shipUrl, data.wer), - // key: curr.key + 1, - // })); - } -};