244
Views
6
Comments
Solved
Outsystems Mobile: Alert User 1 hour before his persistent Login Expires
Question

Hello,

We are using Persistent Login for our mobile app and i want to alert users at least 1 hour before the persistent login time expiration.


Could any one help me out, how i can get read the max idle time set in service center and alert the user?


Thanks,

Preeti Kumari


2021-01-12 14-29-49
Prajakta Roshankhede
Solution

Hello Preeti,

As suggested by Swatantra Kumar, you can use global variables to save user login time and Persistent Timeout time. Instead of JavaScript you can check on OnApplicationReady as well as on OnApplicationResume client action that the difference between both is greater than persistent login or not. If yes give message to user about the same.

Thanks & Regards

Prajakta Roshankhede  

2018-09-27 18-20-33
Swatantra Kumar
Champion

Try using a handler for the ontouchstart event.

Store the last touch time in any global variable, and update this variable in the touch handler. 


Regards,

Swatantra Kumar

2018-09-27 18-20-33
Swatantra Kumar
Champion

Swatantra Kumar wrote:

Try using a handler for the ontouchstart event.

Store the last touch time in any global variable, and update this variable in the touch handler. 


Regards,

Swatantra Kumar

I suggested to use the global variable to store the last active session (last touch time). Alongwith put a javascript on client side to check on regular interval to compare the offset from current time and the value of global variable then alert accordingly.

A nice javascript examle you may refer

https://stackoverflow.com/questions/1191865/code-for-a-simple-javascript-countdown-timer/1192001#1192001

2025-11-19 06-14-01
Miguel Verdasca
Champion

Hi Preeti,

look to this documentation: Configure Mobile App Authentication

I believe that you can management some configurations with Factory Configuration.

Cheers,

Nuno Verdasca


2019-11-05 11-01-40
Preeti Kumari

Let me Explain the scenario

In Service center we have set the Max idle time as 12 Hours, so the user remains logged in to the application for next 12 hours from the time he/she logged in, even the application is closed/untouched/goes offline.(This is working fine).  Now we need below to be handle below scenario.

Step 1: User Login to the application let say at 10 am

Step 2: When 11 hours are past from his last login i.e. at 9 Pm user should get a message on screen saying you would be automatically logged out after 1 hours.

here the main challenge is how to read the Max idle time in code to add the check.


Hope it is clear.


Thanks,

Preeti Kumari


2021-01-12 14-29-49
Prajakta Roshankhede
Solution

Hello Preeti,

As suggested by Swatantra Kumar, you can use global variables to save user login time and Persistent Timeout time. Instead of JavaScript you can check on OnApplicationReady as well as on OnApplicationResume client action that the difference between both is greater than persistent login or not. If yes give message to user about the same.

Thanks & Regards

Prajakta Roshankhede  

2019-11-05 11-01-40
Preeti Kumari

Thanks Prajakta and  Swatantra for your inputs.

I used the client variable newly introduced in outsytems mobile for keeping the value and then check on both application  ready and resume event. and it is not showing the alert properly.


Thanks,

Preeti kumari


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.