iOS universal app with healthkit won't run on iPad
Asked Answered
M

4

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?

Macomber answered 3/9, 2014 at 15:13 Comment(0)
E
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

Entomology answered 4/9, 2014 at 6:2 Comment(9)
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?Macomber
healthkit only available on iOS 8 and above. I've tested on simulator, healthkit still works after I removed it from plist.Entomology
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.Nullifidian
Thank you for your answer. Screw Apple for not making this clearer.Hanover
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.Caldera
yes, you can still read data from health app and apple did approved my app.Entomology
You can check with "HKHealthStore.isHealthDataAvailable()" if HealthKit exists on the device. This is helpful to hide HealthKit functionality on the iPad.Shouse
@Entomology 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.Ppm
@Entomology 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.Deem
D
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

Deem answered 21/8, 2018 at 6:6 Comment(0)
G
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.

Garman answered 18/3, 2015 at 15:11 Comment(0)
M
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

Merrymaker answered 6/12, 2016 at 15:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.