Untitled
unknown
plain_text
2 years ago
1.7 kB
7
Indexable
useEffect(() => {
let eventEmitterSubscription: any;
let inAppClickedEventEmitterSubscription: any;
let notificationReceivedEventEmitterSubscription: any;
SmartechPushReact.addDeepLinkListener(
SmartechPushReact.SmartechDeeplinkNotification,
handleDeeplinkWithPayload,
(eventSubscriptionObject: any) => {
eventEmitterSubscription = eventSubscriptionObject;
}
);
// // Adding the Smartech Deeplink Notification received Listener
SmartechPushReact.addCommonListener(
SmartechPushReact.SmartechNotificationReceived,
handleOnNotificationReceived,
(eventSubscriptionObject) => {
notificationReceivedEventEmitterSubscription = eventSubscriptionObject;
}
);
// Android callback to handle deeplink in terminated/background state.
SmartechPushReact.getDeepLinkUrl(function (_response: any) {
setTimeout(() => {
handleDeeplinkWithPayload(_response);
}, 2000);
});
if (eventEmitterSubscription && inAppClickedEventEmitterSubscription) {
SmartechPushReact.addCommonListener(SmartechPushReact.SmartechInAppOnClick, handleOnInAppCustomHtmlClick, (eventSubscriptionObject) => {
inAppClickedEventEmitterSubscription = eventSubscriptionObject;
});
}
return () => {
eventEmitterSubscription.remove(); // For remove listner
notificationReceivedEventEmitterSubscription.remove(); // For remove listner
};
}, []);Editor is loading...
Leave a Comment