From 514789724ec7df3b8d97aed4605d06d133b3ed0b Mon Sep 17 00:00:00 2001 From: OleSTEEP Date: Sat, 2 Mar 2024 01:23:21 +0300 Subject: [PATCH] Implement exit from app --- www.eng/js/plugins/VND_CordovaFixes.js | 14 +++++++++++++- www.rus/js/plugins/VND_CordovaFixes.js | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/www.eng/js/plugins/VND_CordovaFixes.js b/www.eng/js/plugins/VND_CordovaFixes.js index 875b93d..f8f809c 100644 --- a/www.eng/js/plugins/VND_CordovaFixes.js +++ b/www.eng/js/plugins/VND_CordovaFixes.js @@ -381,4 +381,16 @@ document.addEventListener("deviceready", () => { }); }); } -}) \ No newline at end of file +}) + +// ============================= +// Close Android app from JS +// ============================= + +SceneManager.terminate = function () { + navigator.app.exitApp(); +}; + +window.close = function() { + navigator.app.exitApp(); +} \ No newline at end of file diff --git a/www.rus/js/plugins/VND_CordovaFixes.js b/www.rus/js/plugins/VND_CordovaFixes.js index 64a3f7a..e19681a 100644 --- a/www.rus/js/plugins/VND_CordovaFixes.js +++ b/www.rus/js/plugins/VND_CordovaFixes.js @@ -384,4 +384,16 @@ document.addEventListener("deviceready", () => { }); }); } -}) \ No newline at end of file +}) + +// ============================= +// Close Android app from JS +// ============================= + +SceneManager.terminate = function () { + navigator.app.exitApp(); +}; + +window.close = function() { + navigator.app.exitApp(); +} \ No newline at end of file