Is it possible to enable an orientation lock in a PWA in iOS? I tried the solution described in the following link. It doesn't work for my PWA.

https://www.outsystems.com/forums/discussion/45410/mobile-screen-orientation-lock-in-version-11/

Thanks in advance.

Rajan

By the way, PWAs are cool :)

Rui Barradas wrote:

Hello Rajan,

That solution is indeed correct (I'm also using it in my apps). In alternative, you can use this plugin:

https://www.outsystems.com/forge/component-overview/1429/screen-orientation-plugin


Responding to your question, there are some functionalities that only work with native Android or iOS builds. I believe that this is one of those.

My suggestion is that you try to generate a native build (for Android it is easier) and test it afterwards. It should be working as expected in a native build :)


Kind regards,

Rui Barradas

 @Rui

I think the question is not how to do it for a native OutSystems mobile app.

The question is how to do it for an OutSystems Mobile app that is going to be distributed as an PWA, that can not use Cordova Plugins.

@all

 Apart from the manifest configuration you could try the screen orientation API, it has also methods to lock a screen.

https://caniuse.com/?search=Screen%20orientation

https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation


Regards,

Daniel

PWA cannot access native plugin.