Onbeforeunload is not working

onbeforeunload is not working on the android app but working as ionic server.
Can anyone help me, why is it not working?

Thanks