I'm having an issue where push notifications don't work like expected unless the app is in focus when the notification is received. If the app is in the background or closed when the notification is received then the icon for the notification isn't the one specified for notifications in the config (app.condfig.js), the event added to addNotificationResponseReceivedListener doesn't trigger when the notification is clicked and the result from useLastNotificationResponse() is null. Even if the app is opened and in focus when the notification tapped.
I've set it up like this just inside the NavigationContainer:
const notificationListener = useRef<Notifications.Subscription>();const responseListener = useRef<Notifications.Subscription>();// Notification received to deviceconst notificationReceivedHandler = useCallback((notification: Notifications.Notification) => { // Handel notification}, [])// Notification interacted with by userconst notificationResponseReceivedHandler = useCallback((response: Notifications.NotificationResponse) => { // Handel notification}, [])useEffect(() => { notificationListener.current = Notifications.addNotificationReceivedListener(notificationReceivedHandler); responseListener.current = Notifications.addNotificationResponseReceivedListener(notificationResponseReceivedHandler);}, []);This works like expected as long as the app is in focus when the notification is received. But only then. I still receive notifications when the app is closed or in the background, but they don't trigger the event added to addNotificationResponseReceivedListener, the icon is wrong and the result from useLastNotificationResponse() is null.
I have tried adding a background task with expo-task-manager as well as using notifee instead of expo-notifications, but none of those have solved this issue.






