Why doesn't my Cordova/PhoneGap iOS app rotate when the device rotates?

PiTheNumber picture PiTheNumber · Jun 12, 2012 · Viewed 13k times · Source

I am trying to make a landscape only app, but I am not able to produce any rotation at all.

There used to be a autorotate setting in PhoneGap.plist but in phonegap 1.8.0 I can find it. Does it still exists?

What else could be wrong that my application is not rotating?

UPDATE

I know have webpage containing only one word "test". I set target device to iPad only and enabled all four orientations. What could still be wrong?

Do need to have a special html document type? Do I need to include some cordova-1.8.0.js? I could not find one for iOS (!?!) so i tested it with the android version. I read the API is now the same so can I use the android .js file?

Answer

Amjid Qureshi picture Amjid Qureshi · Sep 10, 2015

I tried the JavaScript solution above and got no joy In Visual Studio 2015 I change the config.xml to

<preference name="orientation" value="all" />

taken from Cordova 5 build command is deleting iOS device orientation settings

I didn't need the javascript just the config setting