How to detect if we are native or not?


Is it possible to know when we are native or not?

Our app is mobile but it must be usable via browser (pc or cellphone). So, some behaviors and logic I want to run only in specific contexts.

E.g. I want to force portrait but if I call that function in web, it will return an error page


Hi, you can check for action "IsCordovaDefined" on "CommonPlugin" module. If it is false you are not running native app.

If cordova is defined (true) so it runs a hybrid? 

I've tried that but instead of returning "true" or "false", it displays an exception...


Hi Otacon,

OutSystems does not support mobile apps running in browsers. You can use Preview in Devices to have a quick look and feel of how the app will look in on your mobile device, but it shouldn't be used for more than testing. Keep in mind that mobile plugins will not work on the browser as well.

The way to achieve your use case should be to create a web responsive app for the browser, and a mobile app.

You can find more about web responsive vs mobile here.

Best regards,

Ricardo Alves