30

I have an universal app and I´ve implemented it to use the healthkit API. It runs great on iPhone but when I try to install it on an actual iPad device (works perfectly in iPad simulator) it wont install.

I am getting the error message: "The Info.plist for application at ... specifies device capability requirements, which are not met by "my ipad"".

I there any way I can distribute an universal app where the healthkit API (framework) only runs on the iPhone?

Heres two screenshots of my project:

This is under "Custom iOS target properties

This is my capabilities tab

Do I really need to make a standalone iPad app?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Philip
  • 2,287
  • 1
  • 22
  • 37

4 Answers4

47

Update: this answer comes many years ago when HealthKit was first introduced on iOS 8. Now, please follow the official guideline: https://developer.apple.com/documentation/healthkit/samples/accessing_health_records?language=objc

--- original answer ---

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

user2423351
  • 491
  • 5
  • 5
  • I´ve tried this and if I do it healthkit won't work on the iPhone. It gives me an error in the capabilities list under "Add the health kit key to your plist file". Or am I doing something wrong? – Philip Sep 04 '14 at 09:24
  • healthkit only available on iOS 8 and above. I've tested on simulator, healthkit still works after I removed it from plist. – user2423351 Sep 04 '14 at 09:34
  • 6
    Right. I did the same way. Moreover, if you are going to run your app on iOS 7 or earlier, don't forget to add runtime check for HealthKit api existence and set Optional flag for HealthKit sdk linkage. – edward Sep 23 '14 at 12:48
  • Thank you for your answer. Screw Apple for not making this clearer. – JAL Dec 18 '14 at 21:19
  • So even with the RED ERROR next to "Add the "HealthKit" key to your info plist file" in the Capabilities List, apple still approve the app? My app supports healthkit, but don't mandate healthkit on the device. I do check healthkit's availability programmatically though. But the red error worries me. – Loc Pham Jan 20 '15 at 03:07
  • yes, you can still read data from health app and apple did approved my app. – user2423351 Jan 30 '15 at 15:06
  • You can check with "HKHealthStore.isHealthDataAvailable()" if HealthKit exists on the device. This is helpful to hide HealthKit functionality on the iPad. – Raphael Jul 14 '16 at 11:10
  • @user2423351 What did you mean "you can remove healthkit from "Required device capabilities" in your project's info.plist"? I have a similar problem which I want to develop an universal app that can read/write to Health app on iPhone and do iCloud sync to iPad. – Adrian Hoe Mar 12 '17 at 04:00
  • @user2423351 If app submitted without healthkit then apple reject your app with this **Guideline 2.5.1 - Performance - Software Requirements Your app uses the HealthKit API but does not indicate integration with the Health app in your app description**. – Kuldeep Aug 16 '18 at 04:50
3

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

enter image description here

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

enter image description here

Kuldeep
  • 4,466
  • 8
  • 32
  • 59
0

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.

Protothomas
  • 79
  • 10
0

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

Tal Haham
  • 1,500
  • 12
  • 16