iOS universal app with healthkit won't run on iPad

人走茶凉 提交于 2019-11-30 01:33:37
user2423351

you can remove healthkit from Required device capabilities in your project's info.plist

Only by removing healthkit from Required device capabilities from info.plist doesn't work.

If you do only above step then apple reject the app with below message.

Your app uses the HealthKit API but does not indicate integration with the Health app in your app description.

You need to do below steps to run your app in both iPhone & iPad.

1. Remove healthkit from Required device capabilities from info.plist

2. You need to set HealthKit.framework as Optional from Linked Frameworks and Libraries

Seems like you can't use HealthKit on the iPad:

From the HealthKit Framework Reference:

Both HealthKit and the Health app are unavailable on iPad. The HealthKit framework cannot be used in an app extension.

From Apple documentation: https://developer.apple.com/reference/healthkit

HealthKit and the Health app are unavailable on iPad.

When you enable the HealthKit capabilities on an iOS app, Xcode adds HealthKit to the list of required device capabilities. This prevents users from purchasing or installing the app on devices that do not support HealthKit.

The two statements together imply that if you add HealthKit capabilities to your app, user will not be able to install your app on iPad.

It can be found in the Device Compatibility Matrix as well: https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!