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
UIRequiredDeviceCapabilities
lets you declare the hardware or specific capabilities that your app needs in order to run.UIRequiredDeviceCapabilities
can be used as a dictionary in Info.plist with a capability as key and its value as YES/NO.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:
It looks like you can use a capability to restrict the device even if you are not actually using that capability in code anywhere.
Apple has mentioned here that AppStore uses this key to prevent users from installing the app.
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:
- 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.
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
Static Linking with Swift, Xcode6-Beta
How to Use Uiactivityitemprovider to Send an Email with Attachment with Uiactivityviewcontroller
Add a Done Button Within a Pop-Up Datepickerview in Swift
How to Do Something Before Unwind Segue Action
Nsuserdefaultsdidchangenotification and Today Extensions
Pass Different Parameters to an Ibaction
Link Errors with Parse.Framework iOS
Add Inverted Circle Overlay to Map View
How to Generate an Uiimage from Custom Text in Swift
Attach a PDF File to Email - Swift
Try Sample Avcam from Apple Found Error
Detect Screen Unlock Events in iOS Swift
Swrevealviewcontroller Close Rear View When Tapping Front View
Ios: Does Force Quitting the App Disables Background Upload Using Nsurlsession
Using Apple's Reachability to Check Remote Server Reachability in Swift
How to Access iOS Private APIs in Swift
Uilocalnotification Isn't Working at All
Opening Testflight App from Another App and Deep Link to Specific App