Skip to content

Fix HealthKit Catalyst build and App Store provisioning - #5264

Merged
bgoncal merged 1 commit into
mainfrom
fix/healthkit-catalyst-build
Jul 28, 2026
Merged

Fix HealthKit Catalyst build and App Store provisioning#5264
bgoncal merged 1 commit into
mainfrom
fix/healthkit-catalyst-build

Conversation

@bgoncal

@bgoncal bgoncal commented Jul 28, 2026

Copy link
Copy Markdown
Member

AI Policy

Select exactly one option that describes AI usage in this contribution:

  • I have not used AI for this contribution.
  • AI assistance was used for this contribution.
  • AI fully generated the code for this contribution, but I've reviewed and understood it before submitting and will respond without AI during review.

Summary

Fixes the CI build failures introduced by the HealthKit sensors change (#4923):

  • The Mac (Catalyst) build failed to compile because SensorListViewModel used Current.healthKitService, which is only defined for iOS (#if os(iOS) && !targetEnvironment(macCatalyst)). The service usage is now guarded behind the same check, and the HealthKit section is hidden on Catalyst.
  • The iOS App Store archive failed to sign because the provisioning profile did not include the HealthKit capability. The iOS App Store - App profile has been updated to include the com.apple.developer.healthkit entitlement.

Screenshots

No visual change on iOS. On Mac Catalyst the (non-functional) HealthKit section is no longer shown.

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

Follow-up to #4923.

Guard HealthKit service usage behind iOS (non-Catalyst) checks so the
Mac Catalyst target compiles, and update the App Store provisioning
profile to include the HealthKit entitlement.
Copilot AI review requested due to automatic review settings July 28, 2026 19:46
@bgoncal
bgoncal enabled auto-merge (squash) July 28, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR resolves build/signing regressions introduced by the earlier HealthKit sensors work by ensuring HealthKit-dependent code is excluded from Mac Catalyst builds and (per the PR description) updating the App Store provisioning profile to include the HealthKit entitlement.

Changes:

  • Guard Current.healthKitService usage behind #if os(iOS) && !targetEnvironment(macCatalyst) in the sensors settings view model.
  • Hide the HealthKit settings section entirely when running under Mac Catalyst.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
Sources/App/Settings/Sensors/List/SensorListViewModel.swift Wraps HealthKit service calls in an iOS-only (non-Catalyst) compile-time guard to fix Catalyst compilation.
Sources/App/Settings/Sensors/List/SensorListView.swift Omits the HealthKit settings section from the UI on Mac Catalyst to match platform capability and avoid non-functional UI.

@bgoncal
bgoncal merged commit a28dcf3 into main Jul 28, 2026
12 checks passed
@bgoncal
bgoncal deleted the fix/healthkit-catalyst-build branch July 28, 2026 20:21
bgoncal added a commit that referenced this pull request Jul 28, 2026
## AI Policy
- [x] I have read the [Open Home Foundation AI
Policy](https://developers.home-assistant.io/docs/ai_policy).

Select exactly one option that describes AI usage in this contribution:

- [ ] I have not used AI for this contribution.
- [x] AI assistance was used for this contribution.
- [ ] AI fully generated the code for this contribution, but I've
reviewed and understood it before submitting and will respond without AI
during review.

## Summary
The App Store upload of the iOS build fails with error 90683 because the
app now ships the HealthKit entitlement but is missing the
`NSHealthUpdateUsageDescription` key in its Info.plist:

> Missing purpose string in Info.plist. ... The Info.plist file for the
"Home Assistant.app" bundle should contain a
NSHealthUpdateUsageDescription key with a user-facing purpose string...

Apple requires this key whenever the HealthKit entitlement is present,
even for read-only usage. The app only reads Health data
(`requestAuthorization` uses an empty `toShare` set), so the purpose
string states that no data is written.

## Screenshots
No visual change. The string is only shown if write access is ever
requested, which the app never does.

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#

## Any other notes
Follow-up to #4923 and #5264.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants