chore: test ios push

This commit is contained in:
GleidsonDaniel 2024-03-18 17:56:32 -03:00
parent afe50aed7e
commit 9c0946eae5
1 changed files with 4 additions and 6 deletions

View File

@ -19,13 +19,11 @@ interface IEjson {
export const onNotification = (push: INotification): void => {
const identifier = String(push?.payload?.action?.identifier);
if (identifier === 'ACCEPT_ACTION' || identifier === 'DECLINE_ACTION') {
if (push?.payload && push?.payload?.ejson) {
if (push?.payload?.ejson) {
const notification = EJSON.parse(push?.payload?.ejson);
store.dispatch(deepLinkingClickCallPush({ ...notification, event: identifier === 'ACCEPT_ACTION' ? 'accept' : 'decline' }));
return;
}
}
if (push?.payload) {
} else if (push?.payload) {
try {
const notification = push?.payload;
if (notification.ejson) {
@ -49,13 +47,13 @@ export const onNotification = (push: INotification): void => {
path: `${types[type]}/${roomName}`
};
store.dispatch(deepLinkingOpen(params));
return;
}
} catch (e) {
console.warn(e);
}
} else {
store.dispatch(appInit());
}
store.dispatch(appInit());
};
export const getDeviceToken = (): string => deviceToken;