How to Properly Set Uirequireddevicecapabilities

How to properly set UIRequiredDeviceCapabilities?

Add this text to your app's Info.plist file:

<key>UIRequiredDeviceCapabilities</key>
<array>
<string>camera-flash</string>
</array>

You only need a dictionary if some of the capability requirements need to be false.

Important note from docs:

For app updates, you can only maintain or relax capability requirements. Submitting an update with added requirements would prevent some customers who previously downloaded your app from running the update.

Add UIRequiredDeviceCapabilities to info.plist using Xcode

This question How to properly set UIRequiredDeviceCapabilities? provides the answer you are looking for as well as a link to the proper spot in the documentation here: http://developer.apple.com/library/ios/#qa/qa1397/_index.html if you have any further questions. Hope that solves it. - Rich

Using UIRequiredDeviceCapabilities in Info.plist to limit compatible devices

  1. UIRequiredDeviceCapabilities lets you declare the hardware or specific capabilities that your app needs in order to run.

  2. UIRequiredDeviceCapabilities can be used as a dictionary in Info.plist with a capability as key and its value as YES/NO.

  3. It does not seem to have any impact on simulators but when run on a device it although compiles but shows a prompt and does not run:
    Sample Image

  4. It looks like you can use a capability to restrict the device even if you are not actually using that capability in code anywhere.

  5. Apple has mentioned here that AppStore uses this key to prevent users from installing the app.

  6. Also, we can not use this key to restrict any device in a update. It looks like any intended restriction needs to be included in the first app version:

Important: All device requirement changes must be made when you submit
an update to your binary. You are permitted only to expand your device
requirements. Submitting an update to your binary to restrict your
device requirements is not permitted. You are unable to restrict
device requirements because this action will keep customers who have
previously downloaded your app from running new updates.

EDIT:


  1. The device capability restriction seems to work even if that particular capability is not available fo the iOS version. To test this, I have set the deployment target as iOS 9.3 and tested on a iPhone 6 device with iOS 10.3.3 version. It still showed me the popup. Here, arkit and nfc are available for iOS 11 onwards.

Sample Image

References:

https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html

https://developer.apple.com/library/content/qa/qa1397/_index.html

Is it possible to setup device-specific UIRequiredDeviceCapabilities in Info.plist

no you cant. you can only request capabilities - you can check the model at runtime only

that said, you can combine certain capabilities to exclude groups of device models

iOS app submit for review fails 'UIRequiredDeviceCapabilities'

Device Compatibility for iTunes submissions.

Here is the relevant section:

Important: All device requirement changes must be made when you submit
an update to your binary. You are permitted only to expand your device
requirements. Submitting an update to your binary to restrict your
device requirements is not permitted. You are unable to restrict
device requirements because this action will keep customers who have
previously downloaded your app from running new updates.

So the short answer is, you cannot do that. If you absolutely must have those flags, then you will need to create a new app for it.



Related Topics



Leave a reply



Submit