Need to see the UIRequiredDeviceCapabilities for your Titanium mobile project? This has been easy in the past through using a custom Info.plist file.
The latest release of Titanium makes this even easier by allow you to device your UIRequiredDeviceCapabilities directly in your tiapp.xml file. For many projects this removes the need to use a custom Info.plist file all together.
Adding UIRequiredDeviceCapabilities to tiapp.xml
- In Titanium Studio click on your project’s tiapp.xml file
- Press the tiapp.xml option at the bottom of the screen so you can see the file’s xml layout
- Find your project’s <iphone>section
- Add a <requires> node into your <iphone>section
- Within the <requires> section add <feature> nodes for each required UIRequiredDeviceCapabilities. For example <feature>sms</feature> would require the device has sms capabilities.
See below for an example:
During the build process Titanium will include any valid device capabilities into the Info.plist file it generates for you. The above example could require your device target to have telephony, sms, and wifi capabilities. Any invalid entries will be discarded. In the above example the “foo” value would be skipped.
Tip – When using this feature for the first time, make sure to clean your project before building.
What feature can I required?
For a full list of UIRequiredDeviceCapabilities values please read Apple’s documentation here.