Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phonegap config.xml settings not working

Tags:

cordova

I have a phonegap ios app that I used to build with phonegaps remote services. https://build.phonegap.com/

I have a few settings in config.xml that works just perfekt there. For example:

<preference name="orientation" value="landscape" />
<preference name="target-device" value="tablet" />
<preference name="webviewbounce" value="false" />

Now I want to build is locally on my Mac but can't get the settings to work.

I have phonegap 3.3.0 and run the following: phonegap build ios phonegap install ios

The app now opens in an iPhone emulator in portrait mode. Can't figure out why my settings isn't working.

like image 460
badtant Avatar asked Nov 10 '22 09:11

badtant


2 Answers

This fix should ideally be in 3.4 release as per this : https://issues.apache.org/jira/browse/CB-5634

But people have reported problems with this after the issue was marked as resolved. So try out the latest patch release of 3.4 and see if it works.

The code to handle this preference simply did not exist prior to 3.4 althouth the docs generously mentioned about it.

like image 110
brahmana Avatar answered Jan 04 '23 03:01

brahmana


I just had the same problem with Cordova version 3.5.0-0.2.1 on iOS using XCode 5. Not sure how this happened - but when I looked in my -info.plist file there were two entries for "Supported interface orientations". One was limited to landscape only (what I wanted) and the other contained both landscape and portrait. Deleting the portrait entries made this work.

I had already updated config.xml and verified from the app's package that the correct info was included in the compiled app.

like image 28
Sean Doyle Avatar answered Jan 04 '23 02:01

Sean Doyle