HealthKit Authorization Requests Immediately Denied in iOS 18.5 - No Permission Dialog Shown

I am experiencing a critical issue with HealthKit authorization in iOS 18.5 where requestAuthorization() calls are immediately denied without showing the user permission dialog.

Problem Description:

  • HealthKit authorization requests immediately return .sharingDenied status
  • No system permission dialog is displayed to the user
  • Authorization status changes from .notDetermined to .sharingDenied in <0.1 seconds
  • This occurs for all HealthKit data types (step count, heart rate, sleep analysis, etc.)

Technical Details:

  • iOS Version: 18.5 (22F76)
  • Xcode Version: 16F6
  • Device: iPhone (tested on both simulator and physical device)
  • Bundle IDs tested: com.hereforyou.test2024, com.hereforyou.app
  • Entitlements: com.apple.developer.healthkit = true

Code Implementation:

let healthStore = HKHealthStore()
let stepType = HKObjectType.quantityType(forIdentifier: .stepCount)!

// Status before request: .notDetermined
try await healthStore.requestAuthorization(toShare: [], read: [stepType])
// Status after request: .sharingDenied (immediate, <0.1 seconds)

Evidence this is not a code issue:

  1. Other HealthKit apps from App Store work correctly on the same device
  2. Proper entitlements are configured and verified
  3. HKHealthStore.isHealthDataAvailable() returns true
  4. Same code worked in previous iOS versions
  5. Multiple Bundle IDs tested with same result

Expected Behavior: System should display HealthKit permission dialog allowing user to grant/deny access

Actual Behavior: Authorization is immediately denied without user interaction

Steps to Reproduce:

  1. Create new iOS app with HealthKit entitlements
  2. Call requestAuthorization() for any HealthKit data type
  3. Observe immediate denial without permission dialog

Is this a known issue in iOS 18.5? Are there any workarounds or timeline for a fix?

Best regards

HealthKit denies the authorization request if your app requested the same authorization for the same sample types and the user denied the request – In this case, if the user changes their mind, they'll need to configure the authorization with the system-provided Health app.

Did you see the same issue if you remove your app on the device and run it again? Removing the app resets the authorization status, and so I'm guessing that will work.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Dear Ziqiao,

Thank you for your response regarding the HealthKit authorization issue.

I followed your suggestion and completely removed the app from the device, then reinstalled and ran it again. Unfortunately, the authorization issue persists even after the app reinstallation. The HealthKit authorization request is still being denied, and the user is not being presented with the authorization dialog.

Since removing and reinstalling the app should reset the authorization status as you mentioned, but the issue continues to occur, this suggests there might be a deeper problem that goes beyond the cached authorization state.

Could you please provide additional guidance on:

  1. Are there any other system-level caches or settings that might need to be cleared beyond app reinstallation?
  2. Could this be related to device-specific settings or iOS version compatibility?
  3. Are there any specific debugging steps or logs we should examine to identify the root cause?
  4. Should we test this on multiple devices to determine if it's device-specific?

I would also be happy to provide additional technical details about our implementation, including:

  • The specific HealthKit sample types we're requesting
  • Our authorization request implementation
  • iOS version and device model being tested
  • Any relevant console logs or error messages

Please let me know what additional information would be helpful for troubleshooting this issue.

Best regards

Thanks for your update. For debugging purpose, do you see the authorization dialog showing up by doing the following?

  • Add a new sample type to the array that you request for authorization, and request again.

  • Try with a brand new HealthKit app with a brand new bundle ID. (You have tested com.hereforyou.test2024 and com.hereforyou.app, but they look pretty formal and so I'm guessing they were used, and hence cached.). A brand new project helps rule out the possibility that something was done to have HealthKit run into a bad situation before it responds the authorization request.

If the issue still presents in the above cases, I'd believe that HealthKit runs into a bad situation on that specific device. You can probably consider erasing all content and settings, or even resetting the device. You can see the options to do so by going to Settings > General, and then scrolling all the way down.

If the same issue happens with a clean app on a clean device, I'll be super curious, and would suggest that you capture a sysdiagnose and file a feedback report with it and your testing project. – If you do so, please share your report ID so we'd take a closer look from there.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

HealthKit Authorization Requests Immediately Denied in iOS 18.5 - No Permission Dialog Shown
 
 
Q