iOS-Working With Property Lists
iOS-Working With Property Lists
Overview
Xamarin Studio features a graphical .plist editor that makes editing app properties and capabilities easier.
Xamarin Studio has two .plists - Info.plist for editing app properties and icons, and
Entitlements.plist for managing app capabilities. This guide introduces the two .plists and provides
an overview of working with them in Xamarin Studio.
Info.plist
The Information Property List ( Info.plist) is a required iOS file that provides information about your
application's configuration to the system. Xamarin Studio's custom Info.plist editor features three
panels controlled by tabs at the bottom left of the editor window:
Application Panel - A graphical interface to set common application properties as well as icons and
launch images; specify maps integration and backgrounding modes.
Advanced Panel - The advanced panel is the place to specify supported document types, UTIs, and
URL types.
Source Panel - The source panel controls less common properties as well as custom properties for
the application.
The next three sections investigate the features of each panel in more detail.
Application Panel
Xamarin Studio features a graphical interface for editing common Info.plist entries for an application:
1. Application properties
2. Supported device types
3. Support orientations for each device type
4. Status bar style and color
5. Icons and start-up screens
6. Maps and Background Modes
This section contains important information that describes your application. The Identifier stored here must
match the Bundle Identifier that is entered in iTunes Connect (for App Store apps) and also in the iOS
Provisioning Portal App IDs list and Development and Distribution certificates.
Device Deployment
The device Deployment info sections are displayed selectively, depending on the selectin in the Devices
dropdown in the Application Target section above. The Main Interface drop-down is set to MainStoryboard
in Storyboard-driven applications. If the user interface is entirely written in code then this can be left blank.
Supported Device Orientations
Supported Device Orientations controls how the app responds to device rotation. It is very common for
iPhone/iPad apps to support only Portrait, or everything but Upside Down. Generally all iPad applications
except games should support all orientations.
The Status Bar Styles section is a graphical interface for editing an application's UIStatusBarStyle:
Icons
The available icon selections are affected by the Devices selection, so iPhone- or iPad-only apps will only
see the relevant icon settings.
The relevant icons and their dimensions are listed below, and discussed in more detail in the Working with
Images document.
App Icons
1. iPhone iOS 5, 6 – 57 x 57
2. iPhone iOS 5, 6 Retina – 114 x 114
3. iPhone iOS 7 Retina - 120 x 120
4. iPad – 72 x 72
Launch Images
A launch image is the first thing the user sees when opening the application. Phone and iPod touch
devices only support portrait launch images, listed below:
1. iPhone – 320 x 480 – Default.png
2. iPhone Retina – 640 x 960 – [email protected]
3. iPhone 4” Retina – 640 x 1136 – [email protected]
iPad devices support a variety of default images, and at a minimum you should supply a Portrait image in
regular and Retina resolution. Xamarin Studio allows you to configure both Portrait and Landscape images,
listed below:
You can use the Resources folder to manage these files. Ensure you follow the correct naming convention
and place the images in the Resources folder with a Build Action of BundledResource. Refer to the
Xamarin Working with Resources guide for more information on the Resource directory.
iOS allows different images to be configured for LandscapeLeft and LandscapeRight using the file
naming convention. Refer to the Xamarin Working with Images guide for more information.
Asset Catalogs
Xamarin Studio gives you the option of migrating icons and launch images to Asset Catalogs. Asset
Catalogs are a convenient way of organizing image sets. To use Asset Catalogs, set all the images for your
icons or launch screens beforehand, and then press Migrate to Asset Catalog. Xamarin Studio will create a
new folder for your assets in the Resources directory, as illustrated by the screenshot below:
You'll be able to select the Asset Catalog from the dropdown inside the Info.plist interface, as
illustrated by the following screenshot:
For more information on Asset Catalogs, refer to Apple's About Asset Catalogs recipe.
iTunes Artwork
iTunes artwork accompanies an application into the iTunes app store. iTunes artwork requires two
resolutions:
The Info.plist contains special sections to specify maps integration and backgrounding modes.
Choosing the options you want to support will add the required properties to your application for you.
For more information on working with maps, refer to the Xamarin iOS Maps guide.
For more information on Background Modes, refer to the Xamarin Backgrounding in iOS guide.
Advanced Panel
The advanced panel controls the document types and URL schemes that the application supports.
Document Types
For applications that support opening specific types of files, iOS provides the CFBundleDocumentTypes
key. If we want our application to support certain known file types - for example PDFs - we would add the
PDF value to the key. This section provides a convenient way to enter the data that will be stored in the
CFBundleDocumentTypes key in the Info.plist file.
Refer to the documentation on Registering the File Types Your App Supports for details on how to
configure these values.
UTIs
Sometimes an application needs to support opening a custom file type. For example, we may want to open
image files with a custom extension .xam. To specify a custom file type, we'll create a custom UTI -
Universal Type Identifier - using the UIExportedTypeDeclarations key. The screenshot below
illustrates how to create a custom UTI for the .xam extension:
Just as exported type UTIs specify custom UTIs specific to your app, the imported type UTIs (
UIImportedTypeDeclarations key) specify custom types supported but not owned by your
application.
For more information on using custom UTIs, refer to Apple's Registering File Types Your App Supports
guide.
Custom URLs
A URL scheme name (also called protocol) is the first part of the URL. For example, http:// and
https:// are common URL schemes. You have the option of creating a custom URL scheme for your
application. Custom URL schemes are used to communicate and send data back and forth with other
applications. The following screenshot illustrates creating a new custom URL scheme called monkeys://:
For more information on implementing custom URL schemes, refer to Apple's Implementing Custom URL
Schemes section of this guide
The Source tab of the Info.plist file allows custom values to be added or edited. Xamarin Studio
provides a list of the most common properties:
For known properties Xamarin Studio will a list of valid values, as illustrated by the following screenshot:
Review Apple’s App Related Resources links for additional information on optional properties.
Entitlements.plist
Entitlements (also called store technologies) are special app capabilities and security permissions granted
to applications correctly configured to use them. These include use of services like iCloud as well as push
notification, PassKit, and more. Entitlements must be linked to an Apple developer account and require a
provisioning profile to be installed on the device and in the application. The Entitlements.plist file
makes specifying entitlements in the application easier.
Adding Entitlements.plist
Older applications may not have an Entitlements.plist in the solution, but one can be added by right-
clicking on the project and choosing Add > New File > iOS > Entitelements.plist, as illustrated by the
screenshot below:
Entitlements can be added by double-clicking to edit the Entitlements.plist file. This will open the
graphical editor, as illustrated by the screenshot below:
The Entitlements.plist currently supports iCloud, Passbook, and Keychain. For more information on
working with entitlements, refer to the Xamarin Device Provisioning guide.
Note: The Entitlements.plist file helps fill in the correct properties for an application using
capabilities, but it can't generate a provisioning profile as it is not linked to an Apple developer account.
You will still need to generate a provisioning profile using the developer portal to deploy and distribute the
application.
Source Panel
Like the Info.plist editor, the Entitlements.plist editor has a source panel. The source panel
allows you to edit the entitlements properties and values directly, as illustrated by the following screenshot:
Summary
This article demonstrated using the graphical and advanced .plist editors to edit common app
configurations as well as to specify icons and launch images. It also introduced the
Entitlements.plist for adding and managing app capabilities.