import React , { useEffect } from 'react' ; import AppLoading from 'expo-app-loading' ; import * as Notifications from 'expo-notifications' ; import Routes from './src/routes' ; import { PlantProps } from './src/libs/storage' ; import { useFonts , Jost_400Regular , Jost_600SemiBold } from '@expo-google-fonts/jost' ; export default function App ( ) { const [ fontsLoaded ] = useFonts ( { Jost_400Regular , Jost_600SemiBold } ) ; useEffect ( ( ) => { Notifications . setNotificationHandler ( { handleNotification : async ( ) => ( { shouldShowAlert : true , shouldPlaySound : false , shouldSetBadge : false , } ) , } ) ; const subscription = Notifications . addNotificationReceivedListener ( async ( notification ) => { const data = notification . request . content . data . plant as PlantProps ; console . log ( data ) ; } ) ; return ( ) => subscription . remove ( ) ; } , [ ] ) ; if ( ! fontsLoaded ) return < AppLoading />; return ( < Routes />); }