From b624112f8bfc5a9364bf8ff5ff0baefa0cbca9fb Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Thu, 28 Sep 2023 09:11:23 -0300 Subject: [PATCH] chore: init background handler --- .../notifications/backgroundNotificationHandler.ts | 12 +++--------- app/lib/notifications/index.ts | 8 +++++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/lib/notifications/backgroundNotificationHandler.ts b/app/lib/notifications/backgroundNotificationHandler.ts index c5bcd61a0..1ece182cd 100644 --- a/app/lib/notifications/backgroundNotificationHandler.ts +++ b/app/lib/notifications/backgroundNotificationHandler.ts @@ -53,6 +53,7 @@ export const backgroundNotificationHandler = async (): Promise => { { cancelable: false } ); + // videoConf channel await notifee.createChannel({ id: 'call', name: 'Video Call', @@ -63,16 +64,9 @@ export const backgroundNotificationHandler = async (): Promise => { }); } - notifee.registerForegroundService( - notification => - new Promise(() => { - console.log('registerForegroundService', notification); - }) - ); + notifee.registerForegroundService(notification => new Promise(() => {})); - notifee.onBackgroundEvent(async event => { - console.log('onBackgroundEvent', event); - }); + notifee.onBackgroundEvent(e => new Promise(() => {})); }; const setBackgroundNotificationHandler = async (): Promise => { diff --git a/app/lib/notifications/index.ts b/app/lib/notifications/index.ts index 167add557..b3f23d821 100644 --- a/app/lib/notifications/index.ts +++ b/app/lib/notifications/index.ts @@ -1,10 +1,11 @@ import EJSON from 'ejson'; -import { store } from '../store/auxStore'; import { deepLinkingOpen } from '../../actions/deepLinking'; -import { isFDroidBuild } from '../constants'; -import { deviceToken, pushNotificationConfigure, setNotificationsBadgeCount, removeAllNotifications } from './push'; import { INotification, SubscriptionType } from '../../definitions'; +import { isFDroidBuild } from '../constants'; +import { store } from '../store/auxStore'; +import { deviceToken, pushNotificationConfigure, removeAllNotifications, setNotificationsBadgeCount } from './push'; +import { backgroundNotificationHandler } from './backgroundNotificationHandler'; interface IEjson { rid: string; @@ -56,6 +57,7 @@ export const removeNotificationsAndBadge = () => { export const initializePushNotifications = (): Promise | undefined => { if (!isFDroidBuild) { setBadgeCount(); + backgroundNotificationHandler(); return pushNotificationConfigure(onNotification); } };