Working With Property Lists

PDF for offline use
Related Recipes:
Related SDKs:
Related Videos:

Let us know how you feel about this


0/250

This document introduces Xamarin Studio's graphical and advanced property list (.plist) editor for working with Info.plist and Entitlements.plist. It illustrates setting icons and launch images for iOS application, and demonstrates specifing app capabilities (entitlements) from inside Xamarin Studio.

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:

Each panel controls different properties, as outlined below:

  • 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

These are described in more detail in the next sections.

iOS Application Target

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.

Status Bar Styles

The Status Bar Styles section is a graphical interface for editing an application's UIStatusBarStyle:

Icons, Launch Images, and iTunes Artwork

Information on using icons, images, and artwork in your Info.plist file can be found in the Working with Images guide.

Maps Integration and Background Modes

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

Source Panel

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:

Xamarin Studio also detects the Property Type, as shown:

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:

Working with Entitlements.plist

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.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.