Mobile App - Previous Screen

  

Hey all,


How can I know which was the previous screen (Navigate -> (Previous Screen) [Reverse Transition]) and, if possible, how can I set it?


Samples of the desired behavior could be*:


1 - [App open] Push Notification > Detail Screen > (back button) > Previous screen (if any)

2 - [App closed] Push Notification > Detail Screen > (back button) > List screen

3 - [App open] List screen > Detail Screen > (back button) > List Screen

4 - [App open] List Screen > Detail Screen > Action (screens in between) > Success screen > (back button) > Detail Screen > (back button) > List Screen


* as I'm trying to make understandable in the samples, the "entry point" of the detail screen can vary and the "exit point" of the screen can also vary.


What I'm seeing right now is that:

for 1), in iOS nothing happens and in Android the app goes to background

for 4), app keeps looping between Success screen and Detail screen.


Thanks in advance,

Armando

Hi Armando, maybe you could make use of the Navigation Javascript API of OutSystems. 

You have javascript methods to navigate back and forward and also another method to navigate to a specific URL. You can also register callbacks for the navigate back event. By using the navigate to method within such callback you can redirect the user to a specific screen when he presses the back button. 

The only problem that you are left with is how to know what is the URL of the previous screen. Maybe you don't need to solve this as I understood from your problem description ;) If you really do, you could build a small web block that you can place in every screen. This web block would store the current url in a local storage entity or in a cookie. By maintaining only two urls in the entity/cookie you always know what is the current url and what is the previous.

Hope this helps.


greetings,

pedro

Hey Pedro, thanks for the info.


I'll take a closer look later today and see if this solves my problem.


Thanks,

Armando