Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handleNotification = async (notification, type) => {
- const {
- setDeeplinkUrl,
- displayOpenAppNotification,
- validateNotificationHandler
- } = this;
- const {profile, reqSetPushNotificationData} = this.props;
- const payloadNotification = notification.payload
- ? notification.payload
- : notification;
- const notificationPayload = {...payloadNotification.data, type};
- const deeplink = `${notificationPayload?.deepLink}&title=${notification?.title}&desc=${notification?.body}`;
- if (type === NOTIF_APP_OPEN) {
- return displayOpenAppNotification({...notification, type});
- }
- setDeeplinkUrl(deeplink);
- await reqSetPushNotificationData({deepLink: deeplink, type});
- if (profile.id !== 0) {
- return validateNotificationHandler();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment