I am trying to call a stop casting function in useEffect clean up function but it is not being called when the app is killed. How can I call a function that will work when app is killed?
P.S. this works on android
useEffect(() => {
return () => {
// Not being called on iOS
sessionManager?.endCurrentSession && sessionManager?.endCurrentSession(true);
};
}, []);