Hello,

I want to trigger sync of data from server, if user is online for more then 15 min.

Can any one help me in this?

Thanks,

Preeti

Hi Preeti,


Try to capture the user login time while logging in and keep checking if user is online till 15 mins So after 15 mins you can sync data from server.


If you still have any questions let me know.


regards,

Krushna

Krushana Mantri wrote:

Hi Preeti,


Try to capture the user login time while logging in and keep checking if user is online till 15 mins So after 15 mins you can sync data from server.


If you still have any questions let me know.


regards,

Krushna

what is the right way to keep checking if user is online till 15 mins, so that we can trigger the sync?

By using Timer or  javascript setintreval or any other?


Solution

An OutSystems timer will not help you. That is for running batch jobs on server. 

You could indeed use a JavaScript setInterval for this. A place to set the interval would be in the OnApplicationResume system event.

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

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

An OutSystems timer will not help you. That is for running batch jobs on server. 

You could indeed use a JavaScript setInterval for this. A place to set the interval would be in the OnApplicationResume system event.

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

Regards,

Daniel

Thanks Daniel, i use this event to call a client function like below:

setInterval(
  function(){$actions.CheckLastSync()},
  900000
);

my CheckLastSync client action is below


Hi,

Yes something like that I had in mind. So just not sure, is there still a question from your side?

Regards,

Daniel