iOS Device Orientation settings in project.pbxproj - xcode

I'm developing an Hybrid iOS application using Cordova (http://cordova.apache.org/).
I need to tweak the device orientation settings manually from the XCode project with Cordova hooks.
I was able to customise the deployment target and the targeted device family with IPHONEOS_DEPLOYMENT_TARGET and TARGETED_DEVICE_FAMILY fields in project.pbxproj respectively, however, can't seem to find how to change orientation settings from there.
I applied the same process that I used to discover the above fields:
Take a copy of project.pbxproj.
Modify the settings from within XCode.
Take another copy of the updated project.pbxproj.
Doing a diff between them.
However it didn't reveal any information for orientation settings change.
Are those settings saved somewhere else?

Finally found the answer.
Orientation settings are found in <project-name>-Info.plist XML file:
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>

Related

How to force portrait orientation in NativeScript 8.x for iOS and Android

There are a few community plugins that made for this, but none of them support NativeScript 8.x. They utilize "tns-core-modules" rather than "#nativescript/core". I've only found one paid plugin that supports NativeScript 8.x.
Is there truly no way to force portrait orientation natively in NativeScript? If not, it seems like a major oversight for a framework dedicated to making mobile apps.
You will have to update your AndroidManifest.xml & Info.plist in your App_Resources.
AndroidManifest.xml
Set screenOrientation to portrait on your main activity
<activity android:name="com.tns.NativeScriptActivity"
...
android:screenOrientation="portrait">
Info.plist
Keep only the portrait orientation, remove rest from UISupportedInterfaceOrientations.
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
Note: Make sure you run a clean build after these changes.

Application's iCloud drive folder doesn't show in macOS

I have an app that needs to store video files in it's own container folder in iCloud Drive. I have tried suggestions from most forums and I still couldn't resolve this issue.
These are the things I did to setup a cloud container for my app -
Added iCloud capability. Selected 'iCloud Documents' for Services and selected the appropriate iCloud container that I had created through my developer account.
Added the following entry in Info.plist
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.TeamName.AppName</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>AppName</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>
These are the values in the entitlement file
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
Have tried with new bundle identifiers and cloud containers.
Have tried updating the Version and the Build value
The app folder is created at '/Users/{user}/Library/Mobile\ Documents/iCloud~com~TeamName~AppName/Documents' and I can see the files I've written to it.
I can find these files at iCloud -> Manage Storage -> AppName on my iPhone too.
Will 'NSUbiquitousContainerIsDocumentScopePublic' be accepted as true only when an app is released on the Appstore? Or it's just that I'm missing something here?
Same here, I followed every tip I could find here and on other websites, but still the folder / files are not showing up visibly.
Problem: ubiquitous container works, files can be read and written, but are not showing up in macOS Finder, nor in the Files app on iOS devices.
macOS 11.5, iOS 14.7, Xcode 12.5.1
I have tried:
everything stated here: https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/FileProvider.html
everything stated here: https://developer.apple.com/library/archive/qa/qa1893/_index.html
every variation of info.plist values for NSUbiquitousContainers (eg. both the container id and my bundle id)
every variation of info.plist values for NSUbiquitousContainerIsDocumentScopePublic
every variation of info.plist values for NSUbiquitousContainerName
every variation of info.plist values for NSUbiquitousContainerSupportedFolderLevels
creating new containers
changing the apps' version and build numbers, including only increasing CFBundleShortVersionString.
changing the apps' bundle identifier
deleting and reinstalling the app
reboots of used devices
switching off/on iCloud drive for the user on all devices
It is driving me crazy. Who can help?

Info.plist may not contain the UIRequiredDeviceCapabilities key

When I try to upload my iOS + apple watch app to iTunes using Application Loader, I get the error message
ERROR ITMS-90595: "Unsupported Key. The Info.plist of bundle Watchless.app/Watch/WatchlessWatchApp.app/PlugIns/WatchlessWatchApp Extension.appex may not contain the UIRequiredDeviceCapabilities key."
Info.plist contains
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>healthkit</string>
</array>
which I think is absolutely necessary because both, watch app and iOS app depend heavily on HealthKit.
The entry is generated when I turn on the HealthKit capability of the watch extension target.
I am running out of ideas what to change.
Using XCode 7.2, Application Loader 3.4
UIRequiredDeviceCapabilities are just your way of saying "I don't want to be installed on device without this functionality".
Removing this will not affect your Watch extension using HealthKit.
Just remove the UIRequiredDeviceCapabilities from the plist in your extension and it should be fine.

Where to add App Icon for iPad PRO [duplicate]

iPad Pro requires 167x167 App icon and 2732 x 2048 (landscape) launch image. But where should I put them? Xcode 7.1 Asset Catalogs don't provide any place to add iPad Pro specific icons or images.
My launch image is size specific, so using storyboard for this isn't a good option.
Apple commented on this issue: "Latest beta (7.2b3) added 83.5#2x app icon slot to asset catalogs, and Developer relations reported in a radar comment that they no longer support launch images and will not be adding the iPad pro launch image size to asset catalogs."
Taken from here.
Use Launch Screen storyboard.
You can also disable Launch Screen File and Launch Images Source from project General settings and use the old way - define all Launch Images in Info.plist.
Info.plist:
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>DefaultPro-Landscape</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{1366, 1024}</string>
</dict>
...
</array>
More info about UILaunchImages in Info.plist in this post:
How do I create launch images for iPhone 6 / 6 Plus Landscape Only Apps?
You should use Launch Screen Files for iPad Pro instead of Launch Images.
First, from iPad Pro, iOS don't support Launch Images, so you can not find the right sizes for iPad Pro's launch images in Xcode 7.1.
Second, if you don't use Launch Screen File, you app running on iPad Pro will be scaled, which is so called 'Display Zoom'.
It looks like you'll need to use the Launch Screen storyboard or xib file to support launch screens specific for iPad Pro.
Per Apple, you should be able to use both the launch image assets to support pre-iOS8, and the Launch Screen file for iOS8+. From the Apple App Distribution Guide :
"For iOS 7 deployment targets, you can supply both a launch screen file and launch images. In iOS 8, the launch screen file is used, and in iOS 7, the launch images are used."
also these docs state:
"If you also need to support earlier versions of iOS, you can continue to supply static launch images in addition to a launch file."
However, in my case even though I have a LaunchScreen.storyboard file, it isn't getting used when I have launch images in an asset catalog. i.e.: I always see the asset catalog launch images instead of the launch screen. I verified the Launch Screen file is set in the info.plist and that it has the "Use as Launch Screen" flag set. I'm also using size classes and auto layout.
If you don't find the "wells" where to put the icons in asset catalogue, perhaps you changed your App settings from iPhone to iPad at a later point and then the iPad "wells" are not visible. You can turn them on by doing this:
The set will only contain image wells for icons that are relevant depending upon your project's configuration at the time the asset catalog was created. If an image well is missing, expand the settings inspector and check the appropriate boxes under the App Icon pane depending upon your project's deployment target and supported devices.

Invalid Bundle Error - "requires launch storyboard"

I keep getting this error when I try to submit my app to the store using Xcode:
ERROR ITMS-90475: "Invalid Bundle. iPad Multitasking support requires launch storyboard in bundle 'com.companyname.appname.'"
Anyone know what this error really means?
This is because you need to specify how your app is supposed to handle multitasking on iPad.
If you don't want to handle multitasking right now, you can simply disable it by going to the "General" tab of your target:
I solved the problem in this way, see here:
If you must opt out of Slide Over and Split View, do so explicitly by adding the UIRequiresFullScreen key to your Xcode project’s Info.plist file and apply the Boolean value YES.
You need to add a Launch Screen (Xcode > File > New).
Under iOS > User Interface you select "Launch Screen" to add it to the project.
For the iPad you need to support all 4 orientations.
Select in Xcode your target file, and under the General Tab, go to the "App icons and Launch Images".
Here you select the Launch Screen file you created.
When you launch the app you'll see the launch (bitmap) images are not used, but the Launch Screen Storyboard.
You can either do it as André showed or directly add:
<key>UIRequiresFullScreen</key>
<true/>
On your .plist file.
If you are using Cordova, you might want to use the cordova-ios-requires-fullscreen plugin (see How to disable iOS9 multitasking through Ionic/Cordova?)
Update: you can also use the cordova-plugin-ipad-multitasking, which seems to also prevent another issue (ITMS-90474)
Update: this should now be fixed using Cordova tools 5.4 without the need for these plugins.
In Xcode 14.2, setting the launch storyboard should be as simple as selecting the required storyboard as Launch Screen File in the "General" settings for the target. This not only avoids spelling mistakes, it also ensures that the storyboard is included in the bundle. However, I found that uploading to the App Store failed as per the OP if support for multiple windows is included (that is, if requires full screen is not checked).
If the storyboard has been configured in this way then the problem may be because the name of the storyboard includes a .storyboard extension, which it's not supposed to (see also post by Muhammad Ibrahim). This can be fixed without checking the box for requires full screen:
In Xcode, go to your build target and select the General tab.
In the section "App Icons and Launch Screen", check if a Storyboard file is selected and if it has a .storyboard extension.
If so -> tap the name of the storyboard to edit it, take off the .storyboard extension and press return.
That's it! The name of the storyboard will no longer show, but the problem will be fixed.
IF you ONLY want to set RequiresFullScreen For iPhone, and support iPad Multitasking, try this:
<key>UILaunchStoryboardName~ipad</key>
<string>LaunchScreenIPad.storyboard</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIRequiresFullScreen~ipad</key>
<false/>
LaunchScreenIPad.storyboard is the name of LaunchScreen for iPad.
iPhone will still use Launch Images Source pictures.
Apple Document Ref: Creating Platform- and Device-Specific Keys
If you want to support split views in iPad, in your info.plist file, set just "LaunchScreen" as the value for key "UILaunchStoryboardName", instead of "LaunchScreen.Storyboard" and you need to support all 4 orientations for iPad.

Resources