Force Mobile App to Close

  

Hi,

I want mobile app to be closed if the user doesn't use it for some time(eg:20mits) and lets the app open as it is or forget to close.  Is there any way I can force to close the Mobile app? like session timeout in Web application.


Thanks,

Karnan


Solution

Hi Karam,

Yes I think it is possible.

Create On the Logics tab on Client Actions the server event OnApplicationReady:

  1. Goto Logic tab
  2. Right click "Client Actions"
  3. Select Add System Events --> On Application Ready
  4. Add a JavaScript flow element between the Start and End

In the javascript flow element enter the following code:

5000 is a timeout of 5 seconds, adjust it according to your needs.

Good Luck,

Daniel


Solution

Thank you!!

Hi, is the navigator.app.exitApp() a built-in?

Do I need to install Cordova plugin?

Thanks.

It is part of Cordova framework that is used by OutSystems to create IOS and android apps, no need to install a plugin.

Thanks Daniël.

It was a very useful info.

Your welcome Harlin, 

if my answer was  a solution to your question could you mark it as a solution?

Regards,

Danfiel

Unfortunately I'm not the topic starter, so I cannot mark it as solution.

Ha my mistake.