TP-52572 | removed abundant comments

This commit is contained in:
Aman Chaturvedi
2024-02-06 12:13:40 +05:30
parent 9b88f9c4ae
commit e3901db4a0
2 changed files with 1 additions and 5 deletions

View File

@@ -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);

View File

@@ -52,7 +52,6 @@ const getFCMToken = async () => {
const notificationListener = (
handleNotificationMessage: (remoteMessage: FirebaseMessagingTypes.RemoteMessage) => Promise<void>
) => {
// 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();