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.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.