From 855957707a4bdbc225030a0ce5e38fed6e2ef27a Mon Sep 17 00:00:00 2001 From: Gauvain Date: Thu, 11 Jun 2026 00:41:48 +0200 Subject: [PATCH] fix(notifications): drop deprecated handler flags and payload logging - shouldShowAlert is deprecated in expo-notifications: specify shouldShowBanner and shouldShowList instead (same behavior). - The foreground listener logged the entire notification object, which touches the deprecated dataString getter (another deprecation warning) and dumps noisy payloads into the console - log only the title. --- app/_layout.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/_layout.tsx b/app/_layout.tsx index 3d75e67c..9992d696 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -84,7 +84,8 @@ configureReanimatedLogger({ if (!Platform.isTV) { Notifications.setNotificationHandler({ handleNotification: async () => ({ - shouldShowAlert: true, + shouldShowBanner: true, + shouldShowList: true, shouldPlaySound: true, shouldSetBadge: false, }), @@ -333,9 +334,12 @@ function Layout() { notificationListener.current = Notifications?.addNotificationReceivedListener( (notification: Notification) => { + // Log only the title — serializing the whole notification touches + // the deprecated dataString getter (deprecation warning) and dumps + // noisy payloads into the console. console.log( - "Notification received while app running", - notification, + "Notification received while app running:", + notification.request.content.title, ); }, );