TP-52572 | removed abundant comments
This commit is contained in:
4
index.js
4
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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user