# [2.0.0](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.0.4...v2.0.0) (2026-11-30)


* feat!: add Capacitor 9 support ([#21](https://github.com/ionic-team/capacitor-health-fitness/issues/21)) ([bd5071b](https://github.com/ionic-team/capacitor-health-fitness/commit/bd5071b55aea81e8f3c7e69a1c8d20ce774b700c)), closes [#6](https://github.com/ionic-team/capacitor-health-fitness/issues/6) [#12](https://github.com/ionic-team/capacitor-health-fitness/issues/12) [#14](https://github.com/ionic-team/capacitor-health-fitness/issues/14) [#13](https://github.com/ionic-team/capacitor-health-fitness/issues/13) [#17](https://github.com/ionic-team/capacitor-health-fitness/issues/17) [#16](https://github.com/ionic-team/capacitor-health-fitness/issues/16)


### BREAKING CHANGES

* Plugin now requires Capacitor 9.
* Align plugin baselines with Capacitor 9

* chore(release): 2.0.0-next.1 [skip ci]

# [2.0.0-next.1](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.1.0-next.2...v2.0.0-next.1) (2026-11-20)

### Bug Fixes

* remove outdated comment ([#16](https://github.com/ionic-team/capacitor-health-fitness/issues/16)) ([f47d2ed](https://github.com/ionic-team/capacitor-health-fitness/commit/f47d2edb1310f1814e2f3d0b24b95d02b63fd37d))

### BREAKING CHANGES

* Align plugin baselines with Capacitor 9

* chore(example-app): turn on shrinkResources

* chore(release): 2.0.0-next.2 [skip ci]

# [2.0.0-next.2](https://github.com/ionic-team/capacitor-health-fitness/compare/v2.0.0-next.1...v2.0.0-next.2) (2026-11-27)

### Bug Fixes

* **android:** keep strings read by name when shrinking resources ([f81074f](https://github.com/ionic-team/capacitor-health-fitness/commit/f81074f298e7e15a072f97ee32499fa576806715))
* **android:** support R8 in release builds ([acfa943](https://github.com/ionic-team/capacitor-health-fitness/commit/acfa943992214f063102ec2f6be039b0f3cbba64))

* chore(release): 2.0.0-next.3 [skip ci]

# [2.0.0-next.3](https://github.com/ionic-team/capacitor-health-fitness/compare/v2.0.0-next.2...v2.0.0-next.3) (2026-11-27)

### Bug Fixes

* **android:** bump ionhealthfitness-android to 1.0.2 ([#18](https://github.com/ionic-team/capacitor-health-fitness/issues/18)) ([be98ff1](https://github.com/ionic-team/capacitor-health-fitness/commit/be98ff12781d79aebba797ae634eb9b839704948))

* chore(release): 2.0.0-next.4 [skip ci]

# [2.0.0-next.4](https://github.com/ionic-team/capacitor-health-fitness/compare/v2.0.0-next.3...v2.0.0-next.4) (2026-11-27)

### Bug Fixes

* **android:** update proguard rules via native lib ([#20](https://github.com/ionic-team/capacitor-health-fitness/issues/20)) ([3343938](https://github.com/ionic-team/capacitor-health-fitness/commit/33439382affe34df3a556e2447c926f21498c5e4))

* chore: migrate to 9.0

# [2.0.0-next.4](https://github.com/ionic-team/capacitor-health-fitness/compare/v2.0.0-next.3...v2.0.0-next.4) (2026-11-27)


### Bug Fixes

* **android:** update proguard rules via native lib ([#20](https://github.com/ionic-team/capacitor-health-fitness/issues/20)) ([3343938](https://github.com/ionic-team/capacitor-health-fitness/commit/33439382affe34df3a556e2447c926f21498c5e4))

# [2.0.0-next.3](https://github.com/ionic-team/capacitor-health-fitness/compare/v2.0.0-next.2...v2.0.0-next.3) (2026-11-27)


### Bug Fixes

* **android:** bump ionhealthfitness-android to 1.0.2 ([#18](https://github.com/ionic-team/capacitor-health-fitness/issues/18)) ([be98ff1](https://github.com/ionic-team/capacitor-health-fitness/commit/be98ff12781d79aebba797ae634eb9b839704948))

# [2.0.0-next.2](https://github.com/ionic-team/capacitor-health-fitness/compare/v2.0.0-next.1...v2.0.0-next.2) (2026-11-27)


### Bug Fixes

* **android:** keep strings read by name when shrinking resources ([f81074f](https://github.com/ionic-team/capacitor-health-fitness/commit/f81074f298e7e15a072f97ee32499fa576806715))
* **android:** support R8 in release builds ([acfa943](https://github.com/ionic-team/capacitor-health-fitness/commit/acfa943992214f063102ec2f6be039b0f3cbba64))

## [1.0.4](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.0.3...v1.0.4) (2026-11-27)


### Bug Fixes

* **android:** bump ionhealthfitness-android to 1.0.2 ([#18](https://github.com/ionic-team/capacitor-health-fitness/issues/18)) ([be98ff1](https://github.com/ionic-team/capacitor-health-fitness/commit/be98ff12781d79aebba797ae634eb9b839704948))
* **android:** update proguard rules via native lib ([#20](https://github.com/ionic-team/capacitor-health-fitness/issues/20)) ([3343938](https://github.com/ionic-team/capacitor-health-fitness/commit/33439382affe34df3a556e2447c926f21498c5e4))

# [2.0.0-next.1](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.1.0-next.2...v2.0.0-next.1) (2026-11-20)


### Bug Fixes

* remove outdated comment ([#16](https://github.com/ionic-team/capacitor-health-fitness/issues/16)) ([f47d2ed](https://github.com/ionic-team/capacitor-health-fitness/commit/f47d2edb1310f1814e2f3d0b24b95d02b63fd37d))


### BREAKING CHANGES

* Align plugin baselines with Capacitor 9

# [1.1.0-next.2](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.1.0-next.1...v1.1.0-next.2) (2026-11-20)


### Bug Fixes

* **android:** avoid implicit parent project property lookup deprecated in Gradle 9 ([#17](https://github.com/ionic-team/capacitor-health-fitness/issues/17)) ([16d1350](https://github.com/ionic-team/capacitor-health-fitness/commit/16d13508e5ce4f919edd04b01d3b2b8359987244))

# [1.1.0-next.1](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.0.3-next.1...v1.1.0-next.1) (2026-11-19)


### Features

* Align plugin baselines with core ([#13](https://github.com/ionic-team/capacitor-health-fitness/issues/13)) ([d96088d](https://github.com/ionic-team/capacitor-health-fitness/commit/d96088d314cea4d6b08a6f523fc995eedc6a7951))

## [1.0.3](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.0.2...v1.0.3) (2026-11-19)


### Bug Fixes

* **android:** keep strings read by name when shrinking resources ([f81074f](https://github.com/ionic-team/capacitor-health-fitness/commit/f81074f298e7e15a072f97ee32499fa576806715))
* **android:** support R8 in release builds ([acfa943](https://github.com/ionic-team/capacitor-health-fitness/commit/acfa943992214f063102ec2f6be039b0f3cbba64))

## [1.0.3-next.1](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.0.2...v1.0.3-next.1) (2026-10-23)


### Bug Fixes

* remove "prepare" for NPM 12 ([8bef0fc](https://github.com/ionic-team/capacitor-health-fitness/commit/8bef0fcdfd58f5fec92c0c6eff28f19a36e6b007))

## [1.0.2](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.0.1...v1.0.2) (2026-10-07)


### Bug Fixes

* **ios:** update native lib to latest version ([#8](https://github.com/ionic-team/capacitor-health-fitness/issues/8)) ([705aed0](https://github.com/ionic-team/capacitor-health-fitness/commit/705aed09b384cd27df97bdc77b06cb7315681348))

## [1.0.1](https://github.com/ionic-team/capacitor-health-fitness/compare/v1.0.0...v1.0.1) (2026-08-19)


### Bug Fixes

* properly handle workoutVariables and doc updates ([#3](https://github.com/ionic-team/capacitor-health-fitness/issues/3)) ([823c093](https://github.com/ionic-team/capacitor-health-fitness/commit/823c0934e53cab6dc40e4bed790c8d988c25557f))

# 1.0.0 (2026-08-17)


### Features

* new health and fitness Capacitor plugin ([#1](https://github.com/ionic-team/capacitor-health-fitness/issues/1)) ([b3b74ee](https://github.com/ionic-team/capacitor-health-fitness/commit/b3b74eeb43ba4fb5f989ff246e38f6cb1548a938))

# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.1]

- iOS: `updateBackgroundJob` now rejects with `HealthKitErrors.backgroundJobNotFound`
  when the given id doesn't match an existing background job, instead of
  silently resolving as if it had succeeded. This is a deliberate divergence
  from the original pre-migration `OSHealthFitnessLib-iOS` (which had the same
  silent no-op), made to match Android's `updateBackgroundJob`, which already
  throws `HealthFitnessError.BACKGROUND_JOB_DOES_NOT_EXIST_ERROR` for the same
  case - Android was the correct behavior here, not the outlier.
- Initial release of the Capacitor Health & Fitness plugin, generated from the
  same API spec as `cordova-outsystems-health-fitness`, delegating to the
  shared `ion-android-healthfitness` and `ion-ios-healthfitness` native
  libraries.
- `requestPermissions` is named `requestHealthPermissions` on this plugin
  instead - it does not follow Capacitor's standard
  `requestPermissions()`/`Promise<PermissionStatus>` contract (it takes
  pre-serialized JSON permission descriptors and resolves void), so it
  intentionally does not override the framework's own reserved method name.
- `updateData` and `enableBackgroundJob` were dropped from the API surface -
  neither was implemented on Android or iOS in the underlying native
  libraries, matching the same removal in `cordova-outsystems-health-fitness`.
- `getWorkoutData` is iOS-only; `disconnectFromHealthConnect` and
  `openHealthConnect` are Android-only. These are genuine platform gaps in the
  underlying native libraries, not bugs - each method is simply not declared
  on the platform that doesn't support it, so calling it there rejects with
  Capacitor's own client-side `"UNIMPLEMENTED"` exception rather than a
  plugin-specific error.
- Fixed several gaps found while auditing this plugin against the Cordova
  plugin's actual behavior, so both now behave identically on well-formed
  *and* malformed input:
  - Android: added the Google Play Services availability gate to all methods
    (previously only `requestHealthPermissions` had it).
  - Android: `@CapacitorPlugin` now declares `requestCodes =
    [REQUEST_PERMISSION_ACTIVITY_KEY_HEALTH]` - the request code the shared
    `ion-android-healthfitness` library uses internally for
    `Activity.startActivityForResult()` in both `requestHealthPermissions()`
    and `requestReadDataBackgroundPermission()`. Without it,
    `Bridge.getPluginWithRequestCode()` can't find this plugin for that code,
    so the result never reaches `handleOnActivityResult()` and the call
    silently hangs after the permission prompt - masked on
    `requestHealthPermissions()` because Health Connect grants the permission
    at the OS level regardless of whether the app receives the result.
  - Android: `setBackgroundJob`'s `ACTIVITY_RECOGNITION`/`POST_NOTIFICATIONS`
    request (needed for activity-recognition-backed variables - `STEPS`,
    `HEART_RATE`, `CALORIES_BURNED`, `BLOOD_PRESSURE`,
    `BASAL_METABOLIC_RATE`, `WALKING_SPEED`, `DISTANCE`) now goes through
    Capacitor's `requestPermissionForAlias()` + `@PermissionCallback` instead
    of a raw `ActivityCompat.requestPermissions()` call with a manually
    tracked request code. The raw approach can never work on a
    `@CapacitorPlugin`-annotated class: unlike `onActivityResult()`,
    `Bridge.onRequestPermissionsResult()` only forwards to a plugin's
    (deprecated) `handleRequestPermissionsResult()` when that plugin uses the
    legacy `@NativePlugin` annotation - never for `@CapacitorPlugin`, no
    matter what `requestCodes` are declared - so `setBackgroundJob` hung
    silently after that permission prompt for every affected variable.
  - Android: `listBackgroundJobs` now resolves under the key `jobs` (matching
    `ListBackgroundJobsResult.jobs` and the iOS bridge's
    `call.resolve(["jobs": result])`), instead of the generic `sendSuccess()`
    helper's hardcoded `results` key - every other `sendSuccess()` caller
    happens to have a `results`-shaped return type, but this one doesn't, so
    `result.jobs` was always `undefined` on Android only.
  - Android: the exact-alarm permission continuation (after `setBackgroundJob`
    opens the system settings screen) now runs from `handleOnResume()` instead
    of `handleOnActivityResult()`, which never fires for the plain
    `startActivity()` call used to open that screen.
  - Android: `writeData` now rejects when `value` is missing, instead of
    silently writing `0.0`.
  - Android: `setBackgroundJob`/`updateBackgroundJob` now explicitly reject
    with `HealthFitnessError.PARSING_PARAMETERS_ERROR` on malformed
    `parameters` JSON, matching `getData`.
  - Android: `disableBackgroundJobs`/`disableReadHealthDataHistory` config
    flags added (`android/healthfitness.config.json`), matching the Cordova
    plugin's `DisableBackgroundJobs`/`DisableReadHealthDataHistory`
    preferences - these two permission groups are no longer unconditionally
    static in the plugin's manifest.
  - iOS: every rejection now carries the same structured `{code, message}`
    shape Android already used, instead of a bare message string.
  - Android: the `capacitor:sync:after` hook now also writes
    `background_notification_title` / `background_notification_description`
    to the consuming app's `strings.xml` (missed when the hook was first
    ported - the plugin reads these unconditionally at load time, so their
    absence crashed the app on startup, not just when `setBackgroundJob` was
    used). This hook writes into the app's *shared* `strings.xml`, unlike the
    Cordova plugin's equivalent (which owns a dedicated
    `os_healthfitness_strings.xml` it fully regenerates every run) - so it
    only fills in a value when one isn't already set, matching this same
    hook's own `privacy_policy_url` convention, instead of unconditionally
    overwriting an already-configured value on every `cap sync`.
  - Android: the hook now always ensures `privacy_policy_url` exists (as an
    empty placeholder when no real URL can be derived), instead of only
    creating it when a privacy-policy file is present. `getPrivacyPolicyUrl()`
    reads it unconditionally on every `requestHealthPermissions()` call, and
    its absence crashed with `Resources.NotFoundException`.
  - Android: added a direct `privacyPolicyUrl` key to
    `android/healthfitness.config.json` - the only option that works for a
    typical Capacitor app, since Health Connect opens the URL in a real
    browser and most apps bundle their web assets locally with no live
    `server.url`. The previous `capacitor.config.json` `server.url` +
    `HealthConnect_PrivacyPolicy.txt`-file derivation is now a fallback for
    apps that already serve their web content remotely.
  - Android: restored the old Capacitor hook's fail-fast behavior for a
    missing/malformed `strings.xml` when writing `privacy_policy_url` - an
    earlier redesign pass had turned both cases into non-fatal `console.log`s,
    which for the missing-file case silently masked a broken Android project
    instead of failing the build immediately with a clear
    `OUTSYSTEMS_PLUGIN_ERROR` message, matching the original.
