I am building a bot for messenger that supports webviews, and for some reasons, I have to be notified if the webview is closed (the user closes the webview from the close
button or back on android).
Does any one knows any way to do it ?
I tried so far the window.onbeforeunload
event, it works when I access the webview url directly in browser and try to refresh/close it, but when i access the webview, I can close it without any event fired.
The MessengerExtensions.requestCloseBrowser
closes the browser and emit success and error callbacks, it does not fire anything when the user closes the window
It is not an iframe issue, since i tried to put my UI in an iframe, then with a button to change the src of the iframe, i got the event fired.
I am using chatfuel as bot platform, spring boot for my backend, reactjs for my webviews.
Thanks in advance.