ionic framework - How to set iOS orientations in cordova config.xml for universal app? -


i have universal app , want portrait orientation iphone , landscape ipad. don't believe can do,

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

because can't see how differentiate between phone , tablet. i've got in root:

... <platform name="ios">     <config-file target="foo-info.plist" platform="ios" parent="uisupportedinterfaceorientations">         <array>             <string>uiinterfaceorientationportrait</string>             <string>uiinterfaceorientationportraitupsidedown</string>         </array>     </config-file>      <config-file target="foo-info.plist" platform="ios" parent="uisupportedinterfaceorientations~ipad">         <array>             <string>uiinterfaceorientationlandscapeleft</string>             <string>uiinterfaceorientationlandscaperight</string>         </array>     </config-file> ... </platform> ... 
  1. why doesn't update app's foo-info.plist? have tried cordova build ios , have tried cordova prepare commands, neither update plist file.
  2. when should these changes take effect? when add ios platform? when cordova build ios?
  3. i need work android phone , tablets if know how.

you don't have hardcode app name here:

<config-file platform="ios" target="*-info.plist" parent="uisupportedinterfaceorientations"> 

to working create hooks/after_prepare/011_update_platform_config.js file, take content here.

install npms:

npm install lodash elementtree plist 

ionic run, ionic build , ionic prepare commands should update project files.

for more information check out this topic

p.s.: should have strong reason use upside-down orientation on iphone otherwise it's pain users (hello ibooks).


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -