I'm developing a chromecast custom receiver, and I need to send a request to the server once the sender disconnects from receiver. When I use ios or android senders, I can see that the 'sender disconnect' event is triggered, but when I use the browser, that event is not triggered.
Because of that, I'm trying to use the 'shutdown' event, to send that request, once the sender is disconnected.
I tried to pass an 'async/await' function as callback to the shutdown event, and tried to force an 'await' on the request, but I get the ' Application should not send requests before the system is ready (they will be ignored)
'
I also tried to use the window 'beforeunload' event, but with no success.
Is there any way to send a request, once the 'shutdown' event is triggered?
Cheers