import { useEffect, useRef } from 'react'; import * as Notifications from './src/services/expoNotifications'; import AppNavigator from './src/navigation/AppNavigator'; export default function App() { const initRef = useRef(false); useEffect(() => { // Run initialization only once if (initRef.current) return; initRef.current = true; (async () => { // Request notification permissions await Notifications.requestPermissionsAsync(); // Set up notification handler (called exactly once) Notifications.setNotificationHandler({ handleNotification: async () => ({ shouldShowAlert: true, shouldPlaySound: true, shouldSetBadge: false, shouldShowBanner: true, shouldShowList: true, }), }); })(); }, []); return ; }