How to handle the event when application returns from Home screen

How to handle the event when application returns from Home screen

  

Please advice me about how to handle the event when application returns from Home screen.

I would like to update the application screen when it return from Home screen of Mobile or another application. But I can't find a event that will fire when application returns from Home screen or another application.

Do you have any idea?

Thanks!!

Environment:

  • Silk UI Mobile
  • Mobile : iPhone

Hi Takahiro,

You mean, when application come from background?

If so, you are looking for the OnResume action:

https://success.outsystems.com/Documentation/10/Reference/Platform_Utilities/System_Events/Mobile/On_Application_Resume

If I remember correctly, it can be add only to the home screen.

Cheers,

Eduardo Jauch

Solution

Eduardo Jauch wrote:

Hi Takahiro,

You mean, when application come from background?

If so, you are looking for the OnResume action:

https://success.outsystems.com/Documentation/10/Reference/Platform_Utilities/System_Events/Mobile/On_Application_Resume

If I remember correctly, it can be add only to the home screen.

Cheers,

Eduardo Jauch

Thank you for your answer.

I added OnApplicationResume to Client Action.

And I tried to change a variable of  Screen but could not find one.
Do you know how to change a variable of Screen?


Thanks. 


Solution

Hi Takahiro,

As the OnApplicationResume is a System Event not bound to any screen, you can't access variables defined in any screen.

But...

If you define a window variable, it should be available cross all screens. On a javascript node you can save the value to window.myVariable. When you want to get that value again, you run a javascript node where you assign window.myVariable to an output parameter and it should do the trick.

Probably you should encapsulate it on client actions like setToken (to assign the value to  the window variable) and getToken (to get the value from javscript to an outsystems variable)

(From here: https://www.outsystems.com/forums/discussion/30152/permanently-store-variable-on-mobile-app/)

So, this would be the way to use variables "cross-pages" in mobile.

Cheers,
Eduardo Jauch