You are not logged in.

#1 2015-07-07 15:00:17

Registered: 2015-04-21
Posts: 64

Close app automatically

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.



#2 2015-07-07 15:20:04

From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,718

Re: Close app automatically

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 "" 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.


Board footer

Powered by FluxBB