分类:
2015-03-16 14:32:00
If your application requires device-related features in order to run, you must add a list of required capabilities to your application. At runtime, iOS will not launch your application unless those capabilities are present on the device. Further, the App Store requires this information so that it can generate a list of requirements for user devices and prevent users from downloading applications that they cannot run.
You add the list of required capabilities by adding the UIRequiredDeviceCapabilities
key to your application’sInfo.plist
file. This key is supported in iOS 3.0 and later. The value of this key is either an array or a dictionary. If you use an array, the presence of a given key indicates that the corresponding feature is required. If you use a dictionary, you must specify a Boolean value for each key. If the value of this key is true, the feature is required. If the value of the key is false, the feature must not be present on the device. In both cases, omitting a key indicates that the feature is not required but that the application is able to run if the feature is present.
Table 7-2 lists the keys that you can include in the array or dictionary associated with the UIRequiredDeviceCapabilities
key. You should include keys only for the features that your application absolutely requires. If your application can accommodate missing features by not executing the appropriate code paths, you do not need to include the corresponding key.
Key | Description |
---|---|
| Include this key if your application requires (or specifically prohibits) the presence of the Phone application. You might require this feature if your application opens URLs with the |
| Include this key if your application requires (or specifically prohibits) access to the networking features of the device. |
| Include this key if your application requires (or specifically prohibits) the presence of the Messages application. You might require this feature if your application opens URLs with the |
| Include this key if your application requires (or specifically prohibits) the presence of a camera on the device. Applications use the |
| Include this key if your application requires (or specifically prohibits) auto-focus capabilities in the device’s still camera. Although most developers should not need to include this key, you might include it if your application supports macro photography or requires sharper images in order to do some sort of image processing. |
| Include this key if your application requires (or specifically prohibits) the presence of a forward-facing camera. Applications use the |
| Include this key if your application requires (or specifically prohibits) the presence of a camera flash for taking pictures or shooting video. Applications use the |
| Include this key if your application requires (or specifically prohibits) the presence of a camera with video capabilities on the device. Applications use the |
| Include this key if your application requires (or specifically prohibits) the presence of accelerometers on the device. Applications use the classes of the Core Motion framework to receive accelerometer events. You do not need to include this key if your application detects only device orientation changes. |
| Include this key if your application requires (or specifically prohibits) the presence of a gyroscope on the device. Applications use the Core Motion framework to retrieve information from gyroscope hardware. |
| Include this key if your application requires (or specifically prohibits) the ability to retrieve the device’s current location using the Core Location framework. (This key refers to the general location services feature. If you specifically need GPS-level accuracy, you should also include the |
| Include this key if your application requires (or specifically prohibits) the presence of GPS (or AGPS) hardware when tracking locations. (You should include this key only if you need the higher accuracy offered by GPS hardware.) If you include this key, you should also include the |
| Include this key if your application requires (or specifically prohibits) the presence of magnetometer hardware. Applications use this hardware to receive heading-related events through the Core Location framework. |
| Include this key if your application requires (or specifically prohibits) Game Center (iOS 4.1 and later.) |
| Include this key if your application uses the built-in microphone or supports accessories that provide a microphone. |
| Include this key if your application requires (or specifically prohibits) the presence of the OpenGL ES 1.1 interfaces. |
| Include this key if your application requires (or specifically prohibits) the presence of the OpenGL ES 2.0 interfaces. |
| Include this key if your application is compiled only for the armv6 instruction set. (iOS 3.1 and later.) |
| Include this key if your application is compiled only for the armv7 instruction set. (iOS 3.1 and later.) |
| Include this key if your application requires (or specifically prohibits) peer-to-peer connectivity over Bluetooth. (iOS 3.1 and later.) |
For detailed information on how to create and edit property lists, see Information Property List Key Reference.