goat
goat

Reputation: 69

Using UIRequiredDeviceCapabilities in Info.plist to limit compatible devices

If I only want my application to run on certain iPhone/iPad models, is it appropriate to specify for instance that my app needs ARKit to achieve this even if my app does not actually use anything from ARKit?

Is there another way to go about this? Also, even after making this change, my app still builds for devices it shouldn’t like the iPhone 5s simulator. Is the device restriction a change that occurs only on the app store?

Upvotes: 0

Views: 3324

Answers (1)

Puneet Sharma
Puneet Sharma

Reputation: 9484

  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: enter image description here

  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.

enter image description here

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

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

Upvotes: 6

Related Questions