Closed Kailash23 closed 1 year ago
Hi @Kailash23. The addListener()
function returns an EmitterSubscription
object, which has a remove()
method that you can call when your component unmounts.
useEffect(() => {
const listener = Braze.addListener(Braze.Events.PUSH_NOTIFICATION_EVENT, handleDeeplinkUrl);
return () => {
listener.remove();
}
}, [handleDeeplinkUrl]);
@Kailash23 It currently only works on Android. You can follow #174 for updates.
What problem are you facing?
I am not able to remove the added event listener I need to remove the event listener when component unmounts
Workarounds
No workarounds
Ideal Solution
No response
Other Information
No response