关于ios:如何将我的应用程序限制在iphone 5s及以上?

How to restrict my app to iphone 5s and above?

我在我的应用程序中使用 healthkit 来读取用户的步骤。但不幸的是,iphone 5 及更低版本没有 M7 传感器,因此我的应用程序无法在这些设备上执行其全部功能。那么有没有可能让拥有 iphone 5 或更低版本的用户无法从应用商店安装我的应用?或任何其他可能的锻炼/行为建议?


恐怕您不能将应用程序限制在特定设备上。

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.

不知道有关 Healthkit 的任何解决方法,但如果有任何可能会导致应用被拒绝。

The value of the UIRequiredDeviceCapabilities key is either an array
or a dictionary that contains additional keys identifying features
your app requires (or specifically prohibits).

Be sure to include keys only for the features that your app absolutely
requires. If your app can run without a specific feature, do not
include the corresponding key.

可以在此处阅读文档中的更多详细信息:

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


我认为您希望在 .plist 文件中使用 UIRequiredDeviceCapabilities 的 HealthKit 键。

关于 UIRequiredDeviceCapabilities 的文档在这里

UIRequiredDeviceCapabilities (Array or Dictionary - iOS) lets iTunes and the App Store know which device-related features an app requires in order to run. iTunes and the mobile App Store use this list to prevent customers from installing apps on a device that does not support the listed capabilities.

healthkit 位说:

healthkit Include this key if your app requires (or specifically prohibits) HealthKit.