@krzysztofkostecki/capacitor-health 8.2.21 → 8.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -805,12 +805,17 @@ final class Health {
805
805
  }
806
806
 
807
807
  private func readAuthorizationStatus(for objectTypes: Set<HKObjectType>, completion: @escaping (Bool) -> Void) {
808
- guard !objectTypes.isEmpty else {
808
+ var requestedObjectTypes = objectTypes
809
+ if requestedObjectTypes.contains(HKSeriesType.workoutRoute()) {
810
+ requestedObjectTypes.insert(HKObjectType.workoutType())
811
+ }
812
+
813
+ guard !requestedObjectTypes.isEmpty else {
809
814
  completion(true)
810
815
  return
811
816
  }
812
817
 
813
- healthStore.getRequestStatusForAuthorization(toShare: Set<HKSampleType>(), read: objectTypes) { status, error in
818
+ healthStore.getRequestStatusForAuthorization(toShare: Set<HKSampleType>(), read: requestedObjectTypes) { status, error in
814
819
  guard error == nil else {
815
820
  completion(false)
816
821
  return
@@ -1966,7 +1971,7 @@ final class Health {
1966
1971
  self.queryFirstAvailableQuantityStream(
1967
1972
  for: workout,
1968
1973
  quantityIdentifiers: metricIdentifiers.power,
1969
- unit: HKUnit.jouleUnit(with: .none).unitDivided(by: HKUnit.second()),
1974
+ unit: HKUnit(from: "W"),
1970
1975
  limit: queryLimit,
1971
1976
  ascending: ascending
1972
1977
  ) { result in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krzysztofkostecki/capacitor-health",
3
- "version": "8.2.21",
3
+ "version": "8.2.23",
4
4
  "description": "Capacitor plugin to interact with data from Apple HealthKit and Health Connect",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",