chore: init background handler
This commit is contained in:
parent
b3a07570ab
commit
b624112f8b
|
@ -53,6 +53,7 @@ export const backgroundNotificationHandler = async (): Promise<void> => {
|
||||||
{ cancelable: false }
|
{ cancelable: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// videoConf channel
|
||||||
await notifee.createChannel({
|
await notifee.createChannel({
|
||||||
id: 'call',
|
id: 'call',
|
||||||
name: 'Video Call',
|
name: 'Video Call',
|
||||||
|
@ -63,16 +64,9 @@ export const backgroundNotificationHandler = async (): Promise<void> => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
notifee.registerForegroundService(
|
notifee.registerForegroundService(notification => new Promise(() => {}));
|
||||||
notification =>
|
|
||||||
new Promise(() => {
|
|
||||||
console.log('registerForegroundService', notification);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
notifee.onBackgroundEvent(async event => {
|
notifee.onBackgroundEvent(e => new Promise(() => {}));
|
||||||
console.log('onBackgroundEvent', event);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const setBackgroundNotificationHandler = async (): Promise<void> => {
|
const setBackgroundNotificationHandler = async (): Promise<void> => {
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import EJSON from 'ejson';
|
import EJSON from 'ejson';
|
||||||
|
|
||||||
import { store } from '../store/auxStore';
|
|
||||||
import { deepLinkingOpen } from '../../actions/deepLinking';
|
import { deepLinkingOpen } from '../../actions/deepLinking';
|
||||||
import { isFDroidBuild } from '../constants';
|
|
||||||
import { deviceToken, pushNotificationConfigure, setNotificationsBadgeCount, removeAllNotifications } from './push';
|
|
||||||
import { INotification, SubscriptionType } from '../../definitions';
|
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 {
|
interface IEjson {
|
||||||
rid: string;
|
rid: string;
|
||||||
|
@ -56,6 +57,7 @@ export const removeNotificationsAndBadge = () => {
|
||||||
export const initializePushNotifications = (): Promise<INotification> | undefined => {
|
export const initializePushNotifications = (): Promise<INotification> | undefined => {
|
||||||
if (!isFDroidBuild) {
|
if (!isFDroidBuild) {
|
||||||
setBadgeCount();
|
setBadgeCount();
|
||||||
|
backgroundNotificationHandler();
|
||||||
return pushNotificationConfigure(onNotification);
|
return pushNotificationConfigure(onNotification);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue