@flomentumsolutions/capacitor-health-extended 0.0.18 → 0.3.1

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.
@@ -3,7 +3,7 @@ require 'json'
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
 
5
5
  Pod::Spec.new do |s|
6
- s.name = 'FlomentumsolutionsCapacitorHealthExtended'
6
+ s.name = 'FlomentumSolutionsCapacitorHealthExtended'
7
7
  s.version = package['version']
8
8
  s.summary = package['description']
9
9
  s.license = package['license']
@@ -12,9 +12,9 @@ Pod::Spec.new do |s|
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  # Only include Swift/Obj-C source files that belong to the plugin
14
14
  s.source_files = 'ios/Sources/HealthPluginPlugin/**/*.{swift,h,m}'
15
- s.ios.deployment_target = '13.0'
16
- s.dependency 'Capacitor', '~> 6.2'
17
- s.dependency 'CapacitorCordova', '~> 6.2'
18
- # Match the Swift shipped with Xcode 16 (use 5.9 for Xcode 15.x)
15
+ s.ios.deployment_target = '15.0'
16
+ s.dependency 'Capacitor', '~> 8.0'
17
+ s.dependency 'CapacitorCordova', '~> 8.0'
18
+ # Match the Swift shipped with Xcode 15/16 (Capacitor 8)
19
19
  s.swift_version = '5.9'
20
- end
20
+ end
package/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2024 - Martin Ley1
4
+ Copyright (c) 2025 - Flomentum Solutions, LLC (Matthew May)
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
package/Package.swift ADDED
@@ -0,0 +1,27 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "FlomentumSolutionsCapacitorHealthExtended",
6
+ platforms: [
7
+ .iOS(.v15)
8
+ ],
9
+ products: [
10
+ .library(
11
+ name: "FlomentumSolutionsCapacitorHealthExtended",
12
+ targets: ["HealthPluginPlugin"]
13
+ )
14
+ ],
15
+ dependencies: [
16
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
17
+ ],
18
+ targets: [
19
+ .target(
20
+ name: "HealthPluginPlugin",
21
+ dependencies: [
22
+ .product(name: "Capacitor", package: "capacitor-swift-pm")
23
+ ],
24
+ path: "ios/Sources/HealthPluginPlugin"
25
+ )
26
+ ]
27
+ )
package/README.md CHANGED
@@ -1,29 +1,60 @@
1
- # capacitor-health-extended
1
+ # @flomentumsolutions/capacitor-health-extended
2
2
 
3
- Capacitor plugin to query data from Apple Health and Google Health Connect
3
+ Cross‑platform Capacitor plugin for reading data from Apple HealthKit and
4
+ Google Health Connect. The plugin requires **Node.js 20+** and is compatible
5
+ with **Capacitor 8**. For iOS the plugin ships a **Swift Package Manager**
6
+ distribution (Capacitor 8 default), while the CocoaPods spec
7
+ `FlomentumSolutionsCapacitorHealthExtended` remains for legacy projects.
4
8
 
5
9
  ## Thanks and attribution
6
10
 
7
- Forked from [capacitor-health](https://github.,com/mley/capacitor-health) and as such...
11
+ Forked from [capacitor-health](https://github.com/mley/capacitor-health) and as such...
8
12
  - Some parts, concepts and ideas are borrowed from [cordova-plugin-health](https://github.com/dariosalvi78/cordova-plugin-health/).
9
13
  - Big thanks to [@dariosalvi78](https://github.com/dariosalvi78) for the support.
10
14
 
11
15
  Thanks [@mley](https://github.com/mley) for the ground work. The goal of this fork is to extend functionality and datapoints and keep up with the ever-changing brand-new Android Health Connect Platform. I'm hoping to create platform parity for capacitor API-based health data access.
12
16
 
17
+ ## Requirements (Plugin & Consuming Apps)
18
+
19
+ - Node.js 22+ (Latest LTS version is recommended)
20
+ - Capacitor 8
21
+ - iOS 15+ (Xcode 26 + HealthKit + SwiftPM toolchain)
22
+ - Android 14+ (Android Studio Otter 2025.2.1 + Health Connect 1.2.0-alpha02 + Gradle 8.13.0 + Kotlin 2.2.20)
23
+
24
+ ## Features
25
+
26
+ - Check if health functionality is available on the device
27
+ - Request and verify health permissions
28
+ - Query aggregated data like steps or calories
29
+ - Retrieve workout sessions with optional route and heart rate data
30
+ - Fetch the latest samples for steps, distance (incl. cycling), calories (active/total/basal), heart‑rate, resting HR, HRV, respiratory rate, blood pressure, oxygen saturation, blood glucose, body temperature (basal + core), body fat, height, weight, flights climbed, sleep, and exercise time.
31
+
32
+ ### Supported data types (parity iOS + Android)
33
+ - Activity: steps, distance, distance‑cycling, exercise time (Apple Exercise Time), workouts (with routes/steps/calories), flights climbed
34
+ - Energy: active calories, total calories, basal calories
35
+ - Vitals: heart rate, resting heart rate, HRV, respiratory rate, blood pressure, oxygen saturation, blood glucose, body temperature, basal body temperature
36
+ - Body: weight, height, body fat
37
+ - Sessions: mindfulness, sleep
38
+
13
39
  ## Install
14
40
 
15
41
  ```bash
16
- npm install capacitor-health-extended
42
+ npm install @flomentumsolutions/capacitor-health-extended
17
43
  npx cap sync
18
44
  ```
19
45
 
20
- ## Setup
46
+ ## Setup Consuming Apps
21
47
 
22
48
  ### iOS
23
49
 
50
+ Capacitor 8 resolves iOS plugins via SwiftPM. Running `npx cap sync ios` will
51
+ add the `FlomentumSolutionsCapacitorHealthExtended` package (backed by
52
+ `capacitor-swift-pm`) to your Xcode project. If you are pinned to Capacitor 7,
53
+ you can keep using the CocoaPods spec `FlomentumSolutionsCapacitorHealthExtended`.
54
+
24
55
  * Make sure your app id has the 'HealthKit' entitlement when this plugin is installed (see iOS dev center).
25
56
  * Also, make sure your app and App Store description comply with the Apple review guidelines.
26
- * There are two keys to be added to the info.plist file: NSHealthShareUsageDescription and NSHealthUpdateUsageDescription.
57
+ * There are two keys to be added to the info.plist file: NSHealthShareUsageDescription and NSHealthUpdateUsageDescription.
27
58
 
28
59
  ### Android
29
60
 
@@ -46,6 +77,17 @@ npx cap sync
46
77
  <uses-permission android:name="android.permission.health.READ_HEIGHT" />
47
78
  <uses-permission android:name="android.permission.health.READ_HEART_RATE_VARIABILITY" />
48
79
  <uses-permission android:name="android.permission.health.READ_BLOOD_PRESSURE" />
80
+ <uses-permission android:name="android.permission.health.READ_MINDFULNESS" />
81
+ <uses-permission android:name="android.permission.health.READ_RESTING_HEART_RATE" />
82
+ <uses-permission android:name="android.permission.health.READ_RESPIRATORY_RATE" />
83
+ <uses-permission android:name="android.permission.health.READ_OXYGEN_SATURATION" />
84
+ <uses-permission android:name="android.permission.health.READ_BLOOD_GLUCOSE" />
85
+ <uses-permission android:name="android.permission.health.READ_BODY_TEMPERATURE" />
86
+ <uses-permission android:name="android.permission.health.READ_BASAL_BODY_TEMPERATURE" />
87
+ <uses-permission android:name="android.permission.health.READ_BODY_FAT" />
88
+ <uses-permission android:name="android.permission.health.READ_FLOORS_CLIMBED" />
89
+ <uses-permission android:name="android.permission.health.READ_BASAL_METABOLIC_RATE" />
90
+ <uses-permission android:name="android.permission.health.READ_SLEEP" />
49
91
  ```
50
92
 
51
93
 
@@ -98,10 +140,9 @@ npx cap sync
98
140
  ```
99
141
 
100
142
  This setup ensures your WebView will load HTTPS content securely and complies with Android's default network security policy.
101
- ```
102
143
 
103
144
  ## API
104
-
145
+ ```
105
146
  <docgen-index>
106
147
 
107
148
  * [`isHealthAvailable()`](#ishealthavailable)
@@ -121,7 +162,7 @@ This setup ensures your WebView will load HTTPS content securely and complies wi
121
162
  * [Type Aliases](#type-aliases)
122
163
 
123
164
  </docgen-index>
124
-
165
+ ```
125
166
  <docgen-api>
126
167
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
127
168
 
@@ -326,7 +367,7 @@ Query latest steps sample
326
367
 
327
368
  | Prop | Type |
328
369
  | ----------------- | ------------------------------------------ |
329
- | **`permissions`** | <code>{ [key: string]: boolean; }[]</code> |
370
+ | **`permissions`** | <code>Record<HealthPermission, boolean></code> |
330
371
 
331
372
 
332
373
  #### PermissionsRequest
@@ -1,20 +1,22 @@
1
+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2
+
1
3
  ext {
2
4
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
5
  androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
7
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
6
8
  }
7
9
 
8
10
  buildscript {
9
11
  ext {
10
- kotlin_version = '2.2.0'
12
+ kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20'
11
13
  }
12
14
  repositories {
13
15
  google()
14
16
  mavenCentral()
15
17
  }
16
18
  dependencies {
17
- classpath 'com.android.tools.build:gradle:8.11.1'
19
+ classpath 'com.android.tools.build:gradle:8.13.0'
18
20
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19
21
  }
20
22
  }
@@ -23,8 +25,8 @@ apply plugin: 'com.android.library'
23
25
  apply plugin: 'org.jetbrains.kotlin.android'
24
26
 
25
27
  android {
26
- namespace "com.flomentum.health.capacitor"
27
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
28
+ namespace = "com.flomentumsolutions.health.capacitor"
29
+ compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
28
30
  defaultConfig {
29
31
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 36
30
32
  targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
@@ -39,14 +41,17 @@ android {
39
41
  }
40
42
  }
41
43
  lintOptions {
42
- abortOnError false
44
+ abortOnError = false
43
45
  }
44
46
  compileOptions {
45
- sourceCompatibility JavaVersion.VERSION_17
46
- targetCompatibility JavaVersion.VERSION_17
47
+ sourceCompatibility JavaVersion.VERSION_21
48
+ targetCompatibility JavaVersion.VERSION_21
47
49
  }
48
- kotlinOptions {
49
- jvmTarget = '17'
50
+ }
51
+
52
+ kotlin {
53
+ compilerOptions {
54
+ jvmTarget = JvmTarget.JVM_21
50
55
  }
51
56
  }
52
57
 
@@ -61,7 +66,7 @@ dependencies {
61
66
  implementation project(':capacitor-android')
62
67
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
63
68
 
64
- implementation 'androidx.health.connect:connect-client:1.1.0-rc03'
69
+ implementation 'androidx.health.connect:connect-client:1.2.0-alpha02'
65
70
  implementation 'androidx.core:core-ktx:1.13.1'
66
71
 
67
72
  testImplementation "junit:junit:$junitVersion"
@@ -1,3 +1,3 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.flomentum.health.capacitor">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.flomentumsolutions.health.capacitor">
2
2
 
3
3
  </manifest>