I want to clear all of navigation history of my application mobile and, return to the first screen when I click on a logout button. It would has any plugin in the Outsystems to do that?

Raj008 wrote:

I want to clear all of navigation history of my application mobile and, return to the first screen when I click on a logout button. It would has any plugin in the Outsystems to do that?

Hi Raj,


You can simple do that using Jquery or javascript .

<script type="text/javascript" >   function preventBack(){window.history.forward();}    setTimeout("preventBack()", 0);    window.onunload=function(){null};</script>


Rahul Sahu wrote:

Raj008 wrote:

I want to clear all of navigation history of my application mobile and, return to the first screen when I click on a logout button. It would has any plugin in the Outsystems to do that?

Hi Raj,


You can simple do that using Jquery or javascript .

<script type="text/javascript" >   function preventBack(){window.history.forward();}    setTimeout("preventBack()", 0);    window.onunload=function(){null};</script>


Thank you for quick update.

This code is not working on my OutSystems Mobile app. Here is the scenario


  1. Login to app in Android device.
  2. Logout from the app.
  3. Re- login into app and then logout.
  4. Now tap the device back button from the Login screen.  Is showing previous login screen two times( How many times you visited )

Here I need solution, how can clear previous screen stack before logout .


Thanks in advanced.

  


Hi Raj008,

I also faced the same issue with login page, After user login if you press the back button it will take you to the loagin screen again. Even if you are already login.

I resolved this issue, By using GetUserId() Function value on the OnIntialize Action of the login screen. If i get the userid from the GetUserId() function then,I use the java script to force close the app.

Attaching sample oml file,for reference.

Hope this will helps you.

Regards,

Koushik

Koushik Prathi wrote:

Hi Raj008,

I also faced the same issue with login page, After user login if you press the back button it will take you to the loagin screen again. Even if you are already login.

I resolved this issue, By using GetUserId() Function value on the OnIntialize Action of the login screen. If i get the userid from the GetUserId() function then,I use the java script to force close the app.

Attaching sample oml file,for reference.

Hope this will helps you.

Regards,

Koushik


Thank you for update.

In my case Multiple login pages are creating as stack.  Single Stack should maintain.


Thanks,

Rajesh R.

The sample I provided will also work fine. with your scenario.Just give it a try.


Koushik Prathi wrote:

The sample I provided will also work fine. with your scenario.Just give it a try.


Hi Koushik,

Your given code is working fine, but I need login page should be there. Given code exit the application completely. 


Hi Raj008,

Once the user is already login why we need to show him the login page again, if you provide some more info it will help me,like scenario.

Regards,

Koushik

Koushik Prathi wrote:

Hi Raj008,

Once the user is already login why we need to show him the login page again, if you provide some more info it will help me,like scenario.

Regards,

Koushik

Hi Koushik,

Thank you for  reply.

If I navigate from Login -> A -> B -> C ->  then select the "Logout" option from the menu, then I should be navigated to the Login page without back stack.

I want clear navigation back history.

Thanks,

Rajesh R