I have a situation where I want to use something like this but not to prompt the user. Rather just call a function to do what I need and then let the app close. So basically I just need to know when the close app event has occurred. Is there something like this available?
Announcement
Collapse
No announcement yet.
Valence.app.setPromptBeforeClose()
Collapse
X
-
Example capturing the close of an app:
Code:(function () { let processed = false; function processClose() { if (processed) { return; } processed = true; //on close logic // FYI : // if making a call to the backend, use navigator.sendBeacon() } window.addEventListener('pagehide', function (event) { if (event.persisted) { return; } processClose(); }); })();
Comment

Comment