From e3901db4a097bc3b267bbbf74aa9652a400f621c Mon Sep 17 00:00:00 2001 From: Aman Chaturvedi Date: Tue, 6 Feb 2024 12:13:40 +0530 Subject: [PATCH] TP-52572 | removed abundant comments --- index.js | 4 +--- src/hooks/useFCM/useFCM.ts | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index f9ff671a..91bc39cc 100644 --- a/index.js +++ b/index.js @@ -61,7 +61,7 @@ messaging().setBackgroundMessageHandler(async (remoteMessage) => { if (data?.payload) { const notification = JSON.parse(data.payload); if (notification?.showAsPn) { - handlePushNotification(notification); + handlePushNotification(notification, true); } // TODO: Try to start foreground service if not working. // const isForegroundServiceRunning = await ForegroundService.is_running(); @@ -83,6 +83,4 @@ notifee.onBackgroundEvent(async (event) => { database().setPersistenceEnabled(true); ReactNativeForegroundService.register(); -// Register the headless task - AppRegistry.registerComponent(appName, () => App); diff --git a/src/hooks/useFCM/useFCM.ts b/src/hooks/useFCM/useFCM.ts index 0f2d1097..f4c0b731 100644 --- a/src/hooks/useFCM/useFCM.ts +++ b/src/hooks/useFCM/useFCM.ts @@ -52,7 +52,6 @@ const getFCMToken = async () => { const notificationListener = ( handleNotificationMessage: (remoteMessage: FirebaseMessagingTypes.RemoteMessage) => Promise ) => { - // messaging().setBackgroundMessageHandler(handleNotificationMessage); const unsubscribe = messaging().onMessage(handleNotificationMessage); return unsubscribe; }; @@ -128,7 +127,6 @@ const useFCM = () => { const notificationListenerUnsubscribe = notificationListener(handleNotificationMessage); // Foreground push notification handler const pushNotificationUnsubscribe = notifee.onForegroundEvent(handleNotificationView); - // checkBackgroundRestrictions(); return () => { notificationListenerUnsubscribe(); pushNotificationUnsubscribe();