@capgo/capacitor-health 7.1.1 → 7.2.0

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.
@@ -22,6 +22,7 @@ import kotlinx.coroutines.withContext
22
22
 
23
23
  @CapacitorPlugin(name = "Health")
24
24
  class HealthPlugin : Plugin() {
25
+ private val PLUGIN_VERSION = "7.1.1"
25
26
  private val manager = HealthManager()
26
27
  private val pluginScope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
27
28
  private var pendingAuthorization: PendingAuthorization? = null
@@ -308,6 +309,17 @@ class HealthPlugin : Plugin() {
308
309
  val writeTypes: List<HealthDataType>
309
310
  )
310
311
 
312
+ @PluginMethod
313
+ fun getPluginVersion(call: PluginCall) {
314
+ try {
315
+ val ret = JSObject()
316
+ ret.put("version", PLUGIN_VERSION)
317
+ call.resolve(ret)
318
+ } catch (e: Exception) {
319
+ call.reject("Could not get plugin version", e)
320
+ }
321
+ }
322
+
311
323
  companion object {
312
324
  private const val REQUEST_AUTHORIZATION = 9501
313
325
  private const val DEFAULT_LIMIT = 100
@@ -3,7 +3,7 @@ import Capacitor
3
3
 
4
4
  @objc(HealthPlugin)
5
5
  public class HealthPlugin: CAPPlugin, CAPBridgedPlugin {
6
- private let PLUGIN_VERSION: String = "7.1.1"
6
+ private let PLUGIN_VERSION: String = "7.2.0"
7
7
  public let identifier = "HealthPlugin"
8
8
  public let jsName = "Health"
9
9
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-health",
3
- "version": "7.1.1",
3
+ "version": "7.2.0",
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",