How to restrict app rotation?

I just wanna restrict my app to work in Portrait mode. How to disable app rotation? @leob Hope you have knowledge on this…

Hi, I think this question has been discussed and answered before on the Ionic forum, the simplest way seems to be this:

Freezing portrait mode

So, quoting the answer:

In config.xml include following:

<preference name="SplashScreen" value="screen" />
<preference name="orientation" value="portrait" />
<preference name="SplashScreenDelay" value="5000" />

and inside $ionicPlatform.ready(function() {}) include following:

if(window.navigator && window.navigator.splashscreen) {

I saw more discussions and solutions but this seems to be the easiest one.


This is not working @leob… Should I install any plugin?

Yeah I’ve also seen people talk about a plugin:

Freezing portrait mode
Ionic View iOS App: Screen Orientation Locked?

So then you can try that (I don’t have experience with any of this since I don’t have this requirement).