509
Views
3
Comments
Solved
How to handle device back button in Outsystems 10 Mobile app
Question

Hi,

I am developing a mobile application. I have to restrict user from clicking back button of the device and also I want to know on how to control the application behavior when user clicks on device back button.

I tried using Javascript Api as mentioned here: https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/Navigation

I have called a JavaScript under Required scripts (at application level). But it does not execute. My finding is that $public is not working for me. My Service Studio version is 10.0.201.0

Thanks,

Waseema.

2025-02-04 11-46-43
Waseema Shaikh
Staff
Solution

Hi Remco,

I found the issue. My server is running older version. I updated by personal environment and things are working now.


Thanks,

Waseema.

Waseema wrote:

Hi Remco,

Thanks for that quick response. But I tried that too.

I am getting an error while publishing. 

So does that mean I need to upgrade my server as well?

Thanks,

Waseema.


Remco Dekkinga wrote:

Hi Waseema,

The $public will not work from the scripts that you place in the 'required scripts' sections (page or application level), but it does work from the JavaScript widget which you can find in the toolbar when you are in an action.

Hope this helps.

Kind regards,

Remco Dekkinga





2023-12-07 07-51-40
Remco Dekkinga
 
MVP

Hi Waseema,

The $public will not work from the scripts that you place in the 'required scripts' sections (page or application level), but it does work from the JavaScript widget which you can find in the toolbar when you are in an action.

Hope this helps.

Kind regards,

Remco Dekkinga

2025-02-04 11-46-43
Waseema Shaikh
Staff

Hi Remco,

Thanks for that quick response. But I tried that too.

I am getting an error while publishing. 

So does that mean I need to upgrade my server as well?

Thanks,

Waseema.


Remco Dekkinga wrote:

Hi Waseema,

The $public will not work from the scripts that you place in the 'required scripts' sections (page or application level), but it does work from the JavaScript widget which you can find in the toolbar when you are in an action.

Hope this helps.

Kind regards,

Remco Dekkinga



Capture.PNG
2025-02-04 11-46-43
Waseema Shaikh
Staff
Solution

Hi Remco,

I found the issue. My server is running older version. I updated by personal environment and things are working now.


Thanks,

Waseema.

Waseema wrote:

Hi Remco,

Thanks for that quick response. But I tried that too.

I am getting an error while publishing. 

So does that mean I need to upgrade my server as well?

Thanks,

Waseema.


Remco Dekkinga wrote:

Hi Waseema,

The $public will not work from the scripts that you place in the 'required scripts' sections (page or application level), but it does work from the JavaScript widget which you can find in the toolbar when you are in an action.

Hope this helps.

Kind regards,

Remco Dekkinga





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