With Cordova 5.1.1, when executing "cordova build ios", any device orientation settings previously selected in the XCode project are deleted leaving the orientation settings checkboxes unselected.
While the "orientation" config preference may provide a means of forcing orientation, I need to be able to set different orientation preferences for the iPad and iPhone.
All previous Cordova versions (below 5) respected those settings. Any ideas?
Using XCode 6.3.2.
EDIT:
According to @Abhinav Gujjar the issue causing
cordova prepare
to overwrite manual changes made to orientation settings in the .plist has been fixed. However, AFAIK there's still no way to set different orientation preferences for iPad vs iPhone in the config.xml, so the answer below stands.UPDATE:
I created the plugin cordova-custom-config, which wraps up the hook below and means platform-specific custom config blocks (such as these orientation settings) can be defined in config.xml. So you can use the plugin rather than need to manually create the hook below.
This was introduced in the Cordova 5.0.0 CLI - see here.
In the meantime, I've been using an after_prepare hook as a workaround. Just place the following in
<your_project>/hooks/after_prepare/some_file.js
and change the orientation settings as appropriate:Note: you'll need to install the plist and xml2js node modules if you don't already have them.