@flomentumsolutions/capacitor-health-extended 0.7.2 → 0.7.4

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.
package/README.md CHANGED
@@ -63,6 +63,8 @@ you can keep using the CocoaPods spec `FlomentumSolutionsCapacitorHealthExtended
63
63
 
64
64
  ### Android
65
65
 
66
+ The plugin namespace/package is `com.flomentumsolutions.capacitorhealthextended.capacitor` (hyphen removed from older `com.flomentumsolutions.capacitor-health-extended` references); use this when wiring activities, manifest entries, or ProGuard rules.
67
+
66
68
  * Android Manifest in root tag right after opening manifest tag
67
69
  ```xml
68
70
  <!-- Make Health Connect visible to detect installation -->
@@ -25,7 +25,7 @@ apply plugin: 'com.android.library'
25
25
  apply plugin: 'org.jetbrains.kotlin.android'
26
26
 
27
27
  android {
28
- namespace = "com.flomentumsolutions.capacitor-health-extended.capacitor"
28
+ namespace = "com.flomentumsolutions.capacitorhealthextended.capacitor"
29
29
  compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
30
30
  defaultConfig {
31
31
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 36
@@ -1,3 +1,3 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.flomentumsolutions.capacitor-health-extended.capacitor">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.flomentumsolutions.capacitorhealthextended.capacitor">
2
2
 
3
3
  </manifest>
@@ -1,4 +1,4 @@
1
- package com.flomentumsolutions.capacitor-health-extended.capacitor
1
+ package com.flomentumsolutions.capacitorhealthextended.capacitor
2
2
 
3
3
  import android.content.Intent
4
4
  import android.util.Log
@@ -28,7 +28,7 @@ public class HealthPlugin: CAPPlugin, CAPBridgedPlugin {
28
28
  let healthStore = HKHealthStore()
29
29
 
30
30
  /// Serial queue to make route‑location mutations thread‑safe without locks
31
- private let routeSyncQueue = DispatchQueue(label: "com.flomentumsolutions.capacitor-health-extended.routeSync")
31
+ private let routeSyncQueue = DispatchQueue(label: "com.flomentumsolutions.capacitorhealthextended.routeSync")
32
32
 
33
33
  @objc func isHealthAvailable(_ call: CAPPluginCall) {
34
34
  let isAvailable = HKHealthStore.isHealthDataAvailable()
@@ -892,9 +892,17 @@ public class HealthPlugin: CAPPlugin, CAPBridgedPlugin {
892
892
  return [HKObjectType.quantityType(forIdentifier: .heartRate)].compactMap { $0 as? HKSampleType }
893
893
  case "WRITE_ROUTE":
894
894
  return [HKSeriesType.workoutRoute()].compactMap { $0 as? HKSampleType }
895
+ case "WRITE_WEIGHT":
896
+ return [HKObjectType.quantityType(forIdentifier: .bodyMass)].compactMap { $0 as? HKSampleType }
897
+ case "WRITE_HEIGHT":
898
+ return [HKObjectType.quantityType(forIdentifier: .height)].compactMap { $0 as? HKSampleType }
899
+ case "WRITE_BODY_FAT":
900
+ return [HKObjectType.quantityType(forIdentifier: .bodyFatPercentage)].compactMap { $0 as? HKSampleType }
901
+ case "WRITE_RESTING_HEART_RATE":
902
+ return [HKObjectType.quantityType(forIdentifier: .restingHeartRate)].compactMap { $0 as? HKSampleType }
895
903
  default:
896
- // For convenience, allow read permissions that are sample types to be added to the share set when requested.
897
- return permissionToHKObjectType(permission).compactMap { $0 as? HKSampleType }
904
+ // Avoid requesting write/share authorization when only read permissions are supplied.
905
+ return []
898
906
  }
899
907
  }
900
908
 
@@ -1788,7 +1796,7 @@ public class HealthPlugin: CAPPlugin, CAPBridgedPlugin {
1788
1796
  return
1789
1797
  }
1790
1798
  let outerGroup = DispatchGroup()
1791
- let resultsQueue = DispatchQueue(label: "com.flomentumsolutions.capacitor-health-extended.workoutResults")
1799
+ let resultsQueue = DispatchQueue(label: "com.flomentumsolutions.capacitorhealthextended.workoutResults")
1792
1800
  var workoutResults: [[String: Any]] = []
1793
1801
  var errors: [String: String] = [:]
1794
1802
 
@@ -1806,8 +1814,8 @@ public class HealthPlugin: CAPPlugin, CAPBridgedPlugin {
1806
1814
  "distance": workout.totalDistance?.doubleValue(for: .meter()) ?? 0
1807
1815
  ]
1808
1816
  let innerGroup = DispatchGroup()
1809
- let heartRateQueue = DispatchQueue(label: "com.flomentumsolutions.capacitor-health-extended.heartRates")
1810
- let routeQueue = DispatchQueue(label: "com.flomentumsolutions.capacitor-health-extended.routes")
1817
+ let heartRateQueue = DispatchQueue(label: "com.flomentumsolutions.capacitorhealthextended.heartRates")
1818
+ let routeQueue = DispatchQueue(label: "com.flomentumsolutions.capacitorhealthextended.routes")
1811
1819
  var localHeartRates: [[String: Any]] = []
1812
1820
  var localRoutes: [[String: Any]] = []
1813
1821
 
@@ -1906,7 +1914,7 @@ public class HealthPlugin: CAPPlugin, CAPBridgedPlugin {
1906
1914
  guard let self = self else { return }
1907
1915
  if let routes = samples as? [HKWorkoutRoute], error == nil {
1908
1916
  let routeDispatchGroup = DispatchGroup()
1909
- let allLocationsQueue = DispatchQueue(label: "com.flomentumsolutions.capacitor-health-extended.allLocations")
1917
+ let allLocationsQueue = DispatchQueue(label: "com.flomentumsolutions.capacitorhealthextended.allLocations")
1910
1918
  var allLocations: [[String: Any]] = []
1911
1919
 
1912
1920
  for route in routes {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flomentumsolutions/capacitor-health-extended",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Capacitor plugin for Apple HealthKit and Google Health Connect Platform",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",