Closed martenbiehl closed 7 years ago
I am having this exact same issue and can confirm that neither of martenbiehl's #1 or #2 edits to config.xml worked for me either. I will be manually setting the configurations in platforms/ios/HelloWorld/HelloWorld-Info.plist for now.
My system: $ phonegap --version 3.5.0-0.21.17 $ sw_vers ProductName: Mac OS X ProductVersion: 10.9.5 BuildVersion: 13F34
Thanks guys!
Same issue for me.
Same issue here
Same issue!
devacc at macmini in ~
$ cordova -v
4.3.0
devacc at macmini in ~
$ phonegap -v
4.2.0-0.24.2
devacc at macmini in ~
$ node -v
v0.12.0
devacc at macmini in ~
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.2
BuildVersion: 14C1510
Still the same issue, and I don't have the option to set things manually in the plist, since its generated on build in my setup.
Still the same issue, incredibly annoying for Phonegap Build users.
+1
+1.
+2
+3 Same issue here.
+4 same issue. iOS 8.4, phonegap 5.1.1
+5 same issue. iOs 8.3, cordova 5.0.0
+6 Cordova 5.1.1
+7
+8
+9
+10
+11
Guys, for those of you still having the issue, I just wrote a simple grunt task to update the plist file and removing the portrait.
grunt.registerTask('updateiOSPlistLandscapeOnly', function () {
var plist = require('plist'),
appName = 'Your Super App',
plistFilepath = path.resolve() + '/' + 'platforms/ios/' + appName + '/' + appName + '-Info.plist',
plistJson = plist.parseFileSync(plistFilepath);
plistJson['UISupportedInterfaceOrientations~ipad'].forEach(function(value, index){
if (value && value.indexOf('Portrait') > -1){
plistJson['UISupportedInterfaceOrientations~ipad'].splice(index, 1);
}
});
var plistObj = plist.build(plistJson);
grunt.verbose.writeln('****Updating plist: removing portrait****');
grunt.file.write(plistFilepath, plistObj);
});
And depending on your build management, either add it to your build workflow (grunt, gulp) either you can it to the hooks. For the last one, within your before_build hooks directory (create it if you don't have it yet), you can just add the following code in a new file (010_remove_portrait.js for example).
#!/usr/bin/env node
var exec = require('child_process').exec;
if (process.env.CORDOVA_CMDLINE.indexOf('ios') > -
function puts(error, stdout, stderr) {
console.log(stdout)
}
exec("grunt updateiOSPlistLandscapeOnly", puts);
An easier and cleaner solution would be to write the code directly within the hooks nodejs script. But as my build was using grunt already with a lot of other tasks, I just went with it.
@ygayl Thanks but this won't help those who use PhoneGap Build online. So we really need that bug fixed.
The issue with IOS 9.0 iPhone devices also, I am using the following lang version
Cordova : 5.3.3
Phonegap : 5.2.0
config.xml :<preference name="orientation" value="portrait" />
I have tried cordova-plugin-screen-orientation, it didnt help
iPhone 6 plus : IOS ( 9.0.2) not working
Any help?
+12
+13
+14 This is a very annoying bug.
I cannot reproduce this with the latest phonegap-cli.
I created a project, added <preference name="Orientation" value="landscape" />
to my config.xml
, ran phonegap build ios
, and I see this under platforms/ios/HelloWorld/HelloWorld-Info.plist
:
➔ ack -i orientation platforms/ios/HelloWorld/HelloWorld-Info.plist
<key>UISupportedInterfaceOrientations</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<key>UISupportedInterfaceOrientations~ipad</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeLeft</string>
Closing.
So it took 3 years to fix this. Unbelievable. 🥇 👍 XD :D
@iharosi incorrect. The issue existed in Apache Cordova land and took one year to fix.
PhoneGap and Apache Cordova are open source projects, and you are more than welcome to help out and fix things. Snark is, generally speaking, unhelpful, and quite frankly, demotivating to all of the contributors spending their time on this trying to help folks like yourself.
Hi!
I can make none of the ways work that are described here http://docs.build.phonegap.com/en_US/2.9.0/configuring_config_file_element.md.html
I am on version 3.5.0-0.21.14 of phonegap installed via npm.
To reproduce:
1. edit config.xml
<preference name="orientation" value="landscape" />
phonegap build ios
openplatforms/ios/HelloWorld/HelloWorld-Info.plist
to check that the setting had no effect2. edit config.xml to contain
phonegap build ios
openplatforms/ios/HelloWorld/HelloWorld-Info.plist
to check that the setting had no effectIs this a bug or is some information missing from the documentation? I can find no information anywhere online to make this work without editing the pList file directly. Yet, I would rather avoid this to not having to manage multiple configuration files and being able to keep up to date with phonegap.
Thanks Marten