Hi!
I'm developing a universal app (iPhone, iPad).
On the iPhone the user can activate a feature to write some data on the Health app trough HealthKit.
This feature is not available on the iPad version because HealthKit is not available on the iPad.
To make an app that use HealthKit and that support both the iPhone and the iPad the apple documentation say this:
If HealthKit is not required for the correct operation of your app, you can open the app’s Info.plist file and delete the healthkit entry from the Required device capabilities array.
https://developer.apple.com/reference/healthkit
The problem is that if I do this I get a red exclamation mark in the HealthKit section under the Capabilities tab and every time that my app enter foreground or enter background this warning message is written to the output:
[default] connection error: Error Domain=com.apple.healthkit Code=1 "Health data is unavailable on this device" UserInfo={NSLocalizedDescription=Health data is unavailable on this device}
The app compile and run correctly both on iPhone and iPad but I want to know if there is a way to hide these messages.
Xcode 8.3.2, iOS 10.3, simulator and real device
Thanks
Alan
Just want to inform that the warning message was displayed because one of my classes had a property assigned to a HKHealthStore object.
The object was not used on the iPad but it looks like it is also important to not instantiate any health kit object.
The xcode red badge it's still there but this is probably just a little xcode bug.