Issue testing the 'Verifiable Health Records' sample code

Hello,

The new iOS 15 'Verifiable Health Records' sample code has an issue when I tap on the 'Request Samples' button:

The call to HKVerifiableClinicalRecordQuery in ContentView.swift:63 comes back with an error:

"Missing required entitlement identifier: verifiable-health-records"

But it's unclear to me where I need to add this entitlement?

In the Target , the HealthKit Capability is added with 'Clinical Health Records' selected. Is that not enough?

I also added "Privacy - Health Records Usage Description" in the Info.plist, but that didn't resolve it.

Thanks, Eiman

So I see that if I add 'verifiable-health-records as a value in the entitlements file's 'HealthKit Capabilities' array, then on the Simulator the UI comes up.

But now I'm unable to run the app on a device because Automatic signing fails with the error Provisioning profile "iOS Team Provisioning Profile: app.ridewith" doesn't match the entitlements file's value for the com.apple.developer.healthkit.access entitlement.

Feels like something buggy is going on.

Sorry, we missed this question. This is explained at the bottom of the documentation to HKVerifiableClinicalRecordQuery: https://developer.apple.com/documentation/healthkit/hkverifiableclinicalrecordquery

In order to run these on real devices you need to manually apply for a profile, which when granted will add the capability to your developer account.

Issue testing the 'Verifiable Health Records' sample code
 
 
Q