Using UIRequiredDeviceCapabilities in Info.plist to limit compatible devices - ios

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?

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

Related

Is there a way to not support my app from iPad or selected iPhone versions?

I had submitted my app as Universal a long time ago and now I need to remove it from the iPad section and few iPhone versions such as 4,5,5S. Is there a way I can achieve this or do I need to show custom not supported screen to user when they install on such devices. Will apple reject my app for this reason?
For restricting your app to only iPhones devices after the app was already published on App Store you should reupload new version of your app to App Store by simply just changing target devices to iPhone only(with different Bundle Identifier of course).
About restricting your app to stop supporting older devices(4,5,5S) you should change your iOS version compatibility. For example iOS 13 is supported on iPhone 6s and newer devices so user won't be able to use it on older devices. Apple should handle this on their own.
There are some alternatives to restrict your app to specific devices with Required device capabilities key which you can find in your Info.plist file. But I don't think apple will accept this, if this features are not actually used in your app.
Here is the documentation about UIRequiredDeviceCapabilities in case you need it.
You can only restrict user from downloading newer versions of your app from App Store ,By changing your apps deployment info in Xcode general tab.
By changing device type from Universal to iPhone only and Deployment target to iOS 13 which in supported by device above 6s. Then user will not be able to download on older versions.
Or you can restrict user access in your app by putting device specific checks and showing your custom ui for unsupported versions. But for this apple may reject your app if it fails in every case for specific device.
But both type of changes you have to upload newer version of app on App Store.

How to distribute enterprise iOS App to specific iPhone device types

How I can restrict an iOS App so that it can install only on specific device type. for example, I do not want my app to install iPhone5, iPhone5S, and iPhone6. I do not want to control it with deployment target settings (iOS version).
And this has to be distributed using Apple Developer Enterprise Program.
You can't prevent the installation of the app on specific devices.
But you can create a splash screen as your first view of the app in which you check the device and prevent the start of the app informing the user.
Well, there is no direct option available to achieve what you requested, because you can select the device type, like iPhone, iPad or Universal while setting up the target,
You can do this in alternate way, on applicationDidFinishLaunching You can simply put a check, if the device is other than the one you wants to provide the support then allow the proceed to the application functionalities, otherwise show a screen with some message showing that, we are not currently providing support on these devices (iPhone5, iPhone5S, and iPhone6)
And as you are going to distribute the application via enterprise account, so you will not need it to get confirmation from the Apple reviewers.
Hope it helps!

Not able to make app iphone only [duplicate]

I'm shipping two binaries; one for iPhone/iTouch and the other for iPad. It's the same application.
Will Apple ensure that the user will never receive an iPhone version of the app on the iPad? If YES, then I don't have anything to worry about, but if not then I do have a problem.
The reason I ask is the iPhone application will simply not work correctly on the iPad because the server knows it's an iPad and will deliver the iPad HD content to it and the iPhone cannot handle that. I would rather not hack my application to send the server a fake device type if running the iPhone app on the iPad in order to receive the correct resources.
Suggestions?
I've been looking for this for a while because I couldn't prevent the iPhone app to load on the iPad. Searched a bit to understand why this was happening, followed #hotpaw2 instructions and found this on the official apple store rules:
UPDATE:
2.4.1 To ensure people get the most out of your app, iPhone apps should run on iPad whenever possible. We encourage you to consider
building universal apps so customers can use them on all of their
devices. Learn more about Universal apps.
https://developer.apple.com/app-store/review/guidelines/
The SDK and/or App store rules prohibit you from preventing an iPhone app from running on an iPad in 1X or 2X zoom mode, unless there are other requirements listed in the app plist. Apple's app review is known to test iPhone-only app submissions (unless there are other requirements) on an iPad, and reject the app if it doesn't run properly.
Other requirements (as listed under UIRequiredDeviceCapabilities in the app's plist) might include your app requiring telephone capabilities (or healthkit, etc.), which might help you temporarily, but still won't prevent the app from running on some hypothetical future iPad product that includes telephony capabilities (and/or healthkit, etc.).
Actually you can.
Add telephony to UIRequiredDeviceCapabilities in your plist file.
But i really not recommend it and maybe you could get rejected because of gratuitously using this property.
I think you should handle that there are iPad versions and iPhone versions on iPads, use the second one as an iPhone.
Also don't forget that retina iPads will use upscaled applications at retina resolution while none retina ones use the standard resolution. And this behavior can tweaked using jailbreak tweaks like RetinaPad and FullForce.
In the plist settings, add Application requires iPhone environment and set the boolean to YES

How can AppStore apps stop supporting ios4?

I have a app on App Store supporting IOS4+ device. However, I really wanted to use some new API feature in ios5 and decided to bump my base SDK to IOS5.
My questions is, what is the setting needed on iTunesConnect? Does Apple allow me to do this? What will happen to those clients running my app on IOS4? Will they just stop receiving update notification from app store?
If Apple forbidden the change, what is the best option for me? I don't want to make another app which has the same interface/functionality but with only iOS5+ device support..
All you need to do is update your project by setting the Deployment Target to your new minimum version. In this case, set the Deployment Target to iOS 5.0 or 5.1. Build and test. When your app is approved, it will only be usable on devices with the version of iOS you selected, or later.
Existing users still on iOS 4 will still be able to use their existing app. But they can't install any further updates.

How to make my app work only on iPhone 3G and higher

Is there a way to limit devices, i.e. iPhone 3G and higher, and not to support the iPhone 2G and lower. I can't find an element that is different. I would limit it to iOS 3.1, however I'm pretty sure that iPhone 2G and lower can run iOS 3.1.
There is a similar question about 3GS+. But 3G+? That might be tough. I don't see anything in the UIRequiredDeviceCapabilities that specifies the 3G radio. You could try using another key based on a hardware feature that the 3G has that the iPhone doesn't, but then you risk getting your build rejected by Apple.
Using run-time checks to detect hardware as Sam Ritchie also suggests is also a bad idea since (1) that will most certainly trigger a rejection, and if it doesn't (2) people with older devices will be able to purchase the app, only to find out it won't run, and they will complain, which will cause Apple to pull your app from sale anyway.
The only way to do it without resorting to things that Apple disallows is to target iOS 4.0 or higher. 4.0 does not run on the 1st generation. I realize you want to target iOS 3.1, but you either allow all devices, or target 4.0.
One nice way to do this would be to check out the UIDevice-Extension project on github. It gives you the ability to detect what hardware you're running on.
I suspect that the way to solve this would be to examine your app and figure out what exactly you don't want a user of an earlier phone to be able to access. Once you've narrows down the feature, you can easily check for the existence of that specific feature on the device. To do this, include the UIDeviceRequiredCapabilities key in Info.plist, and take a look at Apple's Build Time Configuration guide for a list of all possible values. You'll find it under the "Declaring the Required Device Capabilities" heading. Good luck!
Add some minimal Location based functionality to your app (so that Apple can't reject it), and then add the "gps" key to your app's UIRequiredDeviceCapabilities.
But consider that the percentage of 2G's users who actually still buy apps appears to currently be microscopic, and not worth bothering over. Just state the lack of support for these devices in your description.
This answer seems to answer your question:
https://stackoverflow.com/a/4128248/285694
The solution is to require "armv7" in the required device capabilities xml.

Resources