badtant
badtant

Reputation: 183

phonegap config.xml settings not working

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.

Upvotes: 5

Views: 2785

Answers (3)

Koen
Koen

Reputation: 140

Do not place the Config.xml in your root folder but in the same folder as your .html files!

Wrong:
root/page/index.html
root/config.xml

Correct:
root/index.html
root/config.xml

If this doesn't work try placing all .html files and config.xml in root folder

This worked for me, good luck.

Upvotes: -1

Sean Doyle
Sean Doyle

Reputation: 358

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.

Upvotes: 1

brahmana
brahmana

Reputation: 1326

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.

Upvotes: 1

Related Questions