Close app automatically


Walter Hiller

Hello,
is there a possibility to close the app window automatically if i.e. the user changes to another app/window. I think I can use the App.Event Pause and then ... write a JS to close the window? Thanks for your hints.

Walter


DecSoft

Hello Walter,

The Pause app event is not available for browsers, just for apps compiled by App Cordova and for the Amazon Fire OS, Android, BlackBerry 10, iOS, Windows Phone 8 and Windows 8 platforms. But this platforms or browsers does not have a method to "close" an app. The users just go ahead with other apps, and, can back later to our app or simply not. The platforms are responsible to close the apps when the memory is low, etc.

On the other hand, the "window.close" method available for browsers appears to works only for opened windows from a web app, that is, there is not possible to close a web app page by itself. So the only way I can imagine an scenario that allow us to close an app is to use a first app to open the second one. The first one can use the OpenWindow action specifiying the "index.html" of the second app. And the second app can call to the "window.close" method to close their window itself.

In order to keep simple maybe we can use a simple "index.html" as the first app. From this "index.html" file we can use the "window.open" Javascript method in order to open our app in a new window. And then yes, such app can use the "window.close" method to close such window by itself. This can work (remember the times when the webpages start by opening a new window?) and right now its the only scenario I can imagine in order to do something like you wanted. If you have any other question please don't hesitate to post it here.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.