@appeeky/expo-healthkit 0.1.1 → 0.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.
- package/CHANGELOG.md +7 -0
- package/README.md +11 -3
- package/android/src/main/java/expo/modules/healthkit/ExpoHealthKitModule.kt +8 -0
- package/android/src/main/java/expo/modules/healthkit/HealthConnectService.kt +11 -3
- package/build/ExpoHealthKitModule.d.ts +2 -0
- package/build/ExpoHealthKitModule.d.ts.map +1 -1
- package/build/ExpoHealthKitModule.js.map +1 -1
- package/build/ExpoHealthKitModule.web.d.ts +2 -0
- package/build/ExpoHealthKitModule.web.d.ts.map +1 -1
- package/build/ExpoHealthKitModule.web.js +4 -0
- package/build/ExpoHealthKitModule.web.js.map +1 -1
- package/build/index.d.ts +13 -5
- package/build/index.d.ts.map +1 -1
- package/build/index.js +61 -3
- package/build/index.js.map +1 -1
- package/build/types.d.ts +11 -1
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/expo-module.config.json +2 -1
- package/ios/ExpoHealthKitModule.swift +22 -9
- package/ios/HealthKitAppDelegateSubscriber.swift +14 -0
- package/ios/HealthKitObserverCenter.swift +199 -0
- package/ios/HealthKitService.swift +0 -28
- package/package.json +1 -1
- package/src/ExpoHealthKitModule.ts +2 -1
- package/src/ExpoHealthKitModule.web.ts +6 -0
- package/src/index.ts +72 -5
- package/src/types.ts +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [0.2.0](https://github.com/appeeky/expo-healthkit/compare/v0.1.1...v0.2.0) (2026-09-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **ios:** deliver HealthKit background updates before JS starts and hold the completion handler ([6ac0e6f](https://github.com/appeeky/expo-healthkit/commit/6ac0e6fde217940f3e89a7cd5ff64c68a12a0b2b))
|
|
7
|
+
|
|
1
8
|
## [0.1.1](https://github.com/appeeky/expo-healthkit/compare/v0.1.0...v0.1.1) (2026-09-05)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -252,8 +252,10 @@ await HealthKit.deleteObjects({
|
|
|
252
252
|
```ts
|
|
253
253
|
await HealthKit.observe([HealthKit.QuantityType.stepCount]);
|
|
254
254
|
|
|
255
|
-
const subscription = HealthKit.addUpdateListener(({ type }) => {
|
|
256
|
-
// Re-query that type
|
|
255
|
+
const subscription = HealthKit.addUpdateListener(async ({ type }) => {
|
|
256
|
+
// Re-query that type. Return a promise: iOS keeps the app alive and holds
|
|
257
|
+
// the HealthKit completion handler until it settles (~25s cap).
|
|
258
|
+
await syncSteps();
|
|
257
259
|
});
|
|
258
260
|
|
|
259
261
|
await HealthKit.enableBackgroundDelivery(
|
|
@@ -266,6 +268,12 @@ await HealthKit.enableBackgroundDelivery(
|
|
|
266
268
|
|
|
267
269
|
Background delivery needs `isBackgroundDeliveryEnabled: true` on the config plugin and the HealthKit background mode.
|
|
268
270
|
|
|
271
|
+
**Killed-app relaunch.** Types passed to `observe` are persisted natively. When iOS relaunches the app in the background for a HealthKit delivery, the observer queries are re-registered in `didFinishLaunching` (via an Expo AppDelegate subscriber), before the JS runtime boots. The delivery is queued until JS calls `addUpdateListener`, then dispatched. Register your listener at module scope (or early in the root component) so it exists on cold start; `getObservedTypes()` tells you what is already being observed. `clearObservers()` stops and forgets them.
|
|
272
|
+
|
|
273
|
+
**Apple limits.** Step count, distance, energy, exercise/stand time and similar activity types are delivered at most **once per hour** regardless of `UpdateFrequency`; heart rate, sleep, workouts and body measurements are not capped. Each delivery gets ~30 s of background time; the library completes at 25 s if your listener hasn't. The Simulator never relaunches a killed app for HealthKit — test on a device.
|
|
274
|
+
|
|
275
|
+
**Debugging.** Native logs are under the `expo-healthkit` `os_log` subsystem (`restore`, `delivery`, `complete reason=js|timeout`). Full guide with a device test recipe: [`.cursor/skills/expo-healthkit/background-delivery.md`](.cursor/skills/expo-healthkit/background-delivery.md).
|
|
276
|
+
|
|
269
277
|
## 🏷️ Identifiers
|
|
270
278
|
|
|
271
279
|
Pass Apple's raw identifier strings. Named constants are provided for autocomplete; unknown identifiers still work if HealthKit knows them.
|
|
@@ -335,7 +343,7 @@ These throw `ERR_HEALTH_CONNECT_UNSUPPORTED` on Android. Health Connect has no e
|
|
|
335
343
|
| `queryWorkoutRoute` | Workout GPS polylines |
|
|
336
344
|
| `queryHeartbeatSeries` | Beat-to-beat series |
|
|
337
345
|
| `getBiologicalSex`, `getBloodType`, `getDateOfBirth`, `getFitzpatrickSkinType`, `getWheelchairUse` | HealthKit characteristics |
|
|
338
|
-
| `observe`, `enableBackgroundDelivery` | HealthKit observer queries / background delivery |
|
|
346
|
+
| `observe`, `getObservedTypes`, `enableBackgroundDelivery` | HealthKit observer queries / background delivery |
|
|
339
347
|
|
|
340
348
|
### Behavioral differences
|
|
341
349
|
|
|
@@ -169,6 +169,14 @@ class ExpoHealthKitModule : Module() {
|
|
|
169
169
|
AsyncFunction("clearObserverQueries") {
|
|
170
170
|
Unit
|
|
171
171
|
}
|
|
172
|
+
|
|
173
|
+
AsyncFunction("getObservedTypes") {
|
|
174
|
+
emptyList<String>()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
AsyncFunction("completeUpdate") { _: String ->
|
|
178
|
+
Unit
|
|
179
|
+
}
|
|
172
180
|
}
|
|
173
181
|
|
|
174
182
|
private suspend fun requestHealthPermissions(permissions: Set<String>): Set<String> {
|
|
@@ -125,7 +125,7 @@ internal class HealthConnectService(
|
|
|
125
125
|
HealthConnectMapping.SLEEP -> {
|
|
126
126
|
val sessions = readAll(SleepSessionRecord::class, filter, ascending, 0)
|
|
127
127
|
val samples = sessions.flatMap { session -> sleepSamples(session) }
|
|
128
|
-
applyLimit(
|
|
128
|
+
applyLimit(sortSamples(samples, ascending), limit)
|
|
129
129
|
}
|
|
130
130
|
else -> throw HealthConnectUnsupportedException(type)
|
|
131
131
|
}
|
|
@@ -492,8 +492,16 @@ internal class HealthConnectService(
|
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
|
|
496
|
-
|
|
495
|
+
// `readAll` already honours `ascending` at the record level, but flattened
|
|
496
|
+
// records (heart rate series) can interleave, so sort explicitly by start date.
|
|
497
|
+
return applyLimit(sortSamples(samples, ascending), limit)
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
private fun sortSamples(samples: List<Map<String, Any?>>, ascending: Boolean): List<Map<String, Any?>> {
|
|
501
|
+
val sorted = samples.sortedBy { sample ->
|
|
502
|
+
(sample["startDate"] as? String)?.let { runCatching { Instant.parse(it) }.getOrNull() } ?: Instant.EPOCH
|
|
503
|
+
}
|
|
504
|
+
return if (ascending) sorted else sorted.reversed()
|
|
497
505
|
}
|
|
498
506
|
|
|
499
507
|
private fun quantitySamplesFromRecord(type: String, unit: String, record: Record): List<Map<String, Any?>> {
|
|
@@ -33,6 +33,8 @@ declare class ExpoHealthKitModule extends NativeModule<ExpoHealthKitModuleEvents
|
|
|
33
33
|
disableAllBackgroundDelivery(): Promise<boolean>;
|
|
34
34
|
observeTypes(types: string[]): Promise<void>;
|
|
35
35
|
clearObserverQueries(): Promise<void>;
|
|
36
|
+
getObservedTypes(): Promise<string[]>;
|
|
37
|
+
completeUpdate(token: string): Promise<void>;
|
|
36
38
|
}
|
|
37
39
|
declare const _default: ExpoHealthKitModule;
|
|
38
40
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoHealthKitModule.d.ts","sourceRoot":"","sources":["../src/ExpoHealthKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoHealthKitModule.d.ts","sourceRoot":"","sources":["../src/ExpoHealthKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAGzD,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAA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;IAC3E,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IACzD,4BAA4B,IAAI,OAAO,CAAC,OAAO,CAAC;IAChD,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IACrC,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IACrC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAC7C;wBAmCK,mBAAmB;AAlBzB,wBAkB0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoHealthKitModule.js","sourceRoot":"","sources":["../src/ExpoHealthKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoHealthKitModule.js","sourceRoot":"","sources":["../src/ExpoHealthKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAiF1C,MAAM,YAAY,GAAG,mBAAmB,CAAsB,eAAe,CAAC,CAAC;AAE/E,SAAS,uBAAuB,CAAC,KAAc;IAC7C,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK;QACnD,CAAC,CAAC,MAAM,CAAE,KAA2B,CAAC,IAAI,CAAC;QAC3C,CAAC,CAAC,eAAe,CAAC;IACtB,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,oBAAoB,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,OAAO,CAAC;AAChB,CAAC;AAED,eAAe,IAAI,KAAK,CAAC,YAAY,EAAE;IACrC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAY,CAAC;QACjE,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE;YAC5B,IAAI,CAAC;gBACH,MAAM,MAAM,GAAI,KAA0C,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAC/E,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;oBAC9B,OAAO,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBAC/C,CAAC;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,uBAAuB,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;CACF,CAAwB,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { HealthKitError } from './errors';\nimport type {\n ExpoHealthKitModuleEvents,\n NativeActivitySummary,\n NativeActivitySummaryQueryOptions,\n NativeAnchoredQueryOptions,\n NativeAnchoredQueryResult,\n NativeAudiogramSample,\n NativeAuthorizationOptions,\n NativeCategoryQueryOptions,\n NativeCategorySample,\n NativeCategorySampleInput,\n NativeClinicalRecord,\n NativeClinicalRecordQueryOptions,\n NativeCorrelation,\n NativeCorrelationInput,\n NativeCorrelationQueryOptions,\n NativeDateRangeQueryOptions,\n NativeDeleteObjectsOptions,\n NativeElectrocardiogramQueryOptions,\n NativeElectrocardiogramSample,\n NativeHeartbeatSeriesQueryOptions,\n NativeHeartbeatSeriesSample,\n NativeQuantityQueryOptions,\n NativeQuantitySample,\n NativeQuantitySampleInput,\n NativeStatistics,\n NativeStatisticsCollectionQueryOptions,\n NativeStatisticsQueryOptions,\n NativeWorkoutInput,\n NativeWorkoutQueryOptions,\n NativeWorkoutRoute,\n NativeWorkoutRouteQueryOptions,\n NativeWorkoutSample,\n} from './types';\n\ndeclare class ExpoHealthKitModule extends NativeModule<ExpoHealthKitModuleEvents> {\n isHealthDataAvailable(): boolean;\n requestAuthorization(options: NativeAuthorizationOptions): Promise<boolean>;\n getAuthorizationStatus(identifier: string): Promise<number>;\n getRequestStatusForAuthorization(options: NativeAuthorizationOptions): Promise<number>;\n queryQuantitySamples(options: NativeQuantityQueryOptions): Promise<NativeQuantitySample[]>;\n queryCategorySamples(options: NativeCategoryQueryOptions): Promise<NativeCategorySample[]>;\n queryWorkouts(options: NativeWorkoutQueryOptions): Promise<NativeWorkoutSample[]>;\n queryElectrocardiograms(\n options: NativeElectrocardiogramQueryOptions\n ): Promise<NativeElectrocardiogramSample[]>;\n queryActivitySummaries(\n options: NativeActivitySummaryQueryOptions\n ): Promise<NativeActivitySummary[]>;\n queryClinicalRecords(options: NativeClinicalRecordQueryOptions): Promise<NativeClinicalRecord[]>;\n queryAudiograms(options: NativeDateRangeQueryOptions): Promise<NativeAudiogramSample[]>;\n queryWorkoutRoute(options: NativeWorkoutRouteQueryOptions): Promise<NativeWorkoutRoute[]>;\n queryCorrelations(options: NativeCorrelationQueryOptions): Promise<NativeCorrelation[]>;\n queryHeartbeatSeries(\n options: NativeHeartbeatSeriesQueryOptions\n ): Promise<NativeHeartbeatSeriesSample[]>;\n queryStatistics(options: NativeStatisticsQueryOptions): Promise<NativeStatistics>;\n queryStatisticsCollection(\n options: NativeStatisticsCollectionQueryOptions\n ): Promise<NativeStatistics[]>;\n queryAnchored(options: NativeAnchoredQueryOptions): Promise<NativeAnchoredQueryResult>;\n saveQuantitySample(sample: NativeQuantitySampleInput): Promise<string>;\n saveCategorySample(sample: NativeCategorySampleInput): Promise<string>;\n saveWorkout(workout: NativeWorkoutInput): Promise<string>;\n saveCorrelation(correlation: NativeCorrelationInput): Promise<string>;\n deleteObjects(options: NativeDeleteObjectsOptions): Promise<number>;\n getBiologicalSex(): Promise<number>;\n getBloodType(): Promise<number>;\n getDateOfBirth(): Promise<string | null>;\n getFitzpatrickSkinType(): Promise<number>;\n getWheelchairUse(): Promise<number>;\n enableBackgroundDelivery(type: string, frequency: number): Promise<boolean>;\n disableBackgroundDelivery(type: string): Promise<boolean>;\n disableAllBackgroundDelivery(): Promise<boolean>;\n observeTypes(types: string[]): Promise<void>;\n clearObserverQueries(): Promise<void>;\n getObservedTypes(): Promise<string[]>;\n completeUpdate(token: string): Promise<void>;\n}\n\nconst nativeModule = requireNativeModule<ExpoHealthKitModule>('ExpoHealthKit');\n\nfunction rethrowAsHealthKitError(error: unknown): never {\n const message = error instanceof Error ? error.message : String(error);\n const code =\n error && typeof error === 'object' && 'code' in error\n ? String((error as { code: unknown }).code)\n : 'ERR_HEALTHKIT';\n const wrapped = new HealthKitError(message, code);\n if (__DEV__) {\n console.warn(`[expo-healthkit] ${code}: ${message}`);\n }\n throw wrapped;\n}\n\nexport default new Proxy(nativeModule, {\n get(target, property, receiver) {\n const value = Reflect.get(target, property, receiver) as unknown;\n if (typeof value !== 'function') {\n return value;\n }\n return (...args: unknown[]) => {\n try {\n const result = (value as (...inner: unknown[]) => unknown).apply(target, args);\n if (result instanceof Promise) {\n return result.catch(rethrowAsHealthKitError);\n }\n return result;\n } catch (error) {\n rethrowAsHealthKitError(error);\n }\n };\n },\n}) as ExpoHealthKitModule;\n"]}
|
|
@@ -33,6 +33,8 @@ declare class ExpoHealthKitModule extends NativeModule<ExpoHealthKitModuleEvents
|
|
|
33
33
|
disableAllBackgroundDelivery(): Promise<boolean>;
|
|
34
34
|
observeTypes(): Promise<void>;
|
|
35
35
|
clearObserverQueries(): Promise<void>;
|
|
36
|
+
getObservedTypes(): Promise<string[]>;
|
|
37
|
+
completeUpdate(): Promise<void>;
|
|
36
38
|
}
|
|
37
39
|
declare const _default: typeof ExpoHealthKitModule;
|
|
38
40
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoHealthKitModule.web.d.ts","sourceRoot":"","sources":["../src/ExpoHealthKitModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,MAAM,CAAC;AAGvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAMzD,cAAM,mBAAoB,SAAQ,YAAY,CAAC,yBAAyB,CAAC;IACvE,qBAAqB,IAAI,OAAO;IAI1B,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxC,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzC,gCAAgC,IAAI,OAAO,CAAC,MAAM,CAAC;IAInD,oBAAoB,IAAI,OAAO,CAAC,KAAK,CAAC;IAItC,oBAAoB,IAAI,OAAO,CAAC,KAAK,CAAC;IAItC,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC;IAI/B,uBAAuB,IAAI,OAAO,CAAC,KAAK,CAAC;IAIzC,sBAAsB,IAAI,OAAO,CAAC,KAAK,CAAC;IAIxC,oBAAoB,IAAI,OAAO,CAAC,KAAK,CAAC;IAItC,eAAe,IAAI,OAAO,CAAC,KAAK,CAAC;IAIjC,iBAAiB,IAAI,OAAO,CAAC,KAAK,CAAC;IAInC,iBAAiB,IAAI,OAAO,CAAC,KAAK,CAAC;IAInC,oBAAoB,IAAI,OAAO,CAAC,KAAK,CAAC;IAItC,eAAe,IAAI,OAAO,CAAC,KAAK,CAAC;IAIjC,yBAAyB,IAAI,OAAO,CAAC,KAAK,CAAC;IAI3C,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC;IA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;;AAED,wBAA6E"}
|
|
@@ -100,6 +100,10 @@ class ExpoHealthKitModule extends NativeModule {
|
|
|
100
100
|
async clearObserverQueries() {
|
|
101
101
|
return unavailable();
|
|
102
102
|
}
|
|
103
|
+
async getObservedTypes() {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
async completeUpdate() { }
|
|
103
107
|
}
|
|
104
108
|
export default registerWebModule(ExpoHealthKitModule, 'ExpoHealthKitModule');
|
|
105
109
|
//# sourceMappingURL=ExpoHealthKitModule.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoHealthKitModule.web.js","sourceRoot":"","sources":["../src/ExpoHealthKitModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,SAAS,WAAW;IAClB,MAAM,IAAI,yBAAyB,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,mBAAoB,SAAQ,YAAuC;IACvE,qBAAqB;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,gCAAgC;QACpC,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,OAAO,WAAW,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AC,wBAAwB;QAC5B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,yBAAyB;QAC7B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,4BAA4B;QAChC,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoHealthKitModule.web.js","sourceRoot":"","sources":["../src/ExpoHealthKitModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,SAAS,WAAW;IAClB,MAAM,IAAI,yBAAyB,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,mBAAoB,SAAQ,YAAuC;IACvE,qBAAqB;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,gCAAgC;QACpC,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IA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AAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,yBAAyB;QAC7B,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,4BAA4B;QAChC,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,cAAc,KAAmB,CAAC;CACzC;AAED,eAAe,iBAAiB,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { NativeModule, registerWebModule } from 'expo';\n\nimport { HealthKitUnavailableError } from './errors';\nimport type { ExpoHealthKitModuleEvents } from './types';\n\nfunction unavailable(): never {\n throw new HealthKitUnavailableError();\n}\n\nclass ExpoHealthKitModule extends NativeModule<ExpoHealthKitModuleEvents> {\n isHealthDataAvailable(): boolean {\n return false;\n }\n\n async requestAuthorization(): Promise<boolean> {\n return unavailable();\n }\n\n async getAuthorizationStatus(): Promise<number> {\n return unavailable();\n }\n\n async getRequestStatusForAuthorization(): Promise<number> {\n return unavailable();\n }\n\n async queryQuantitySamples(): Promise<never> {\n return unavailable();\n }\n\n async queryCategorySamples(): Promise<never> {\n return unavailable();\n }\n\n async queryWorkouts(): Promise<never> {\n return unavailable();\n }\n\n async queryElectrocardiograms(): Promise<never> {\n return unavailable();\n }\n\n async queryActivitySummaries(): Promise<never> {\n return unavailable();\n }\n\n async queryClinicalRecords(): Promise<never> {\n return unavailable();\n }\n\n async queryAudiograms(): Promise<never> {\n return unavailable();\n }\n\n async queryWorkoutRoute(): Promise<never> {\n return unavailable();\n }\n\n async queryCorrelations(): Promise<never> {\n return unavailable();\n }\n\n async queryHeartbeatSeries(): Promise<never> {\n return unavailable();\n }\n\n async queryStatistics(): Promise<never> {\n return unavailable();\n }\n\n async queryStatisticsCollection(): Promise<never> {\n return unavailable();\n }\n\n async queryAnchored(): Promise<never> {\n return unavailable();\n }\n\n async saveQuantitySample(): Promise<string> {\n return unavailable();\n }\n\n async saveCategorySample(): Promise<string> {\n return unavailable();\n }\n\n async saveWorkout(): Promise<string> {\n return unavailable();\n }\n\n async saveCorrelation(): Promise<string> {\n return unavailable();\n }\n\n async deleteObjects(): Promise<number> {\n return unavailable();\n }\n\n async getBiologicalSex(): Promise<number> {\n return unavailable();\n }\n\n async getBloodType(): Promise<number> {\n return unavailable();\n }\n\n async getDateOfBirth(): Promise<string | null> {\n return unavailable();\n }\n\n async getFitzpatrickSkinType(): Promise<number> {\n return unavailable();\n }\n\n async getWheelchairUse(): Promise<number> {\n return unavailable();\n }\n\n async enableBackgroundDelivery(): Promise<boolean> {\n return unavailable();\n }\n\n async disableBackgroundDelivery(): Promise<boolean> {\n return unavailable();\n }\n\n async disableAllBackgroundDelivery(): Promise<boolean> {\n return unavailable();\n }\n\n async observeTypes(): Promise<void> {\n return unavailable();\n }\n\n async clearObserverQueries(): Promise<void> {\n return unavailable();\n }\n\n async getObservedTypes(): Promise<string[]> {\n return [];\n }\n\n async completeUpdate(): Promise<void> {}\n}\n\nexport default registerWebModule(ExpoHealthKitModule, 'ExpoHealthKitModule');\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthorizationRequestStatus, AuthorizationStatus, BiologicalSex, BloodType, FitzpatrickSkinType, UpdateFrequency, WheelchairUse } from './identifiers';
|
|
2
|
-
import type { AnchoredQueryOptions, AnchoredQueryResult, AuthorizationOptions, CategorySample, CategorySampleInput, ClinicalRecord, ClinicalRecordQueryOptions, Correlation, CorrelationInput, CorrelationQueryOptions, DeleteObjectsOptions, ElectrocardiogramQueryOptions, ElectrocardiogramSample, ActivitySummary, ActivitySummaryQueryOptions, AudiogramSample, DateRangeQueryOptions, HeartbeatSeriesQueryOptions, HeartbeatSeriesSample, QuantityQueryOptions, QuantitySample, SampleQueryOptions, QuantitySampleInput, Statistics, StatisticsCollectionQueryOptions, StatisticsQueryOptions, WorkoutInput, WorkoutQueryOptions, WorkoutRoute, WorkoutRouteQueryOptions, WorkoutSample } from './types';
|
|
2
|
+
import type { AnchoredQueryOptions, AnchoredQueryResult, AuthorizationOptions, CategorySample, CategorySampleInput, ClinicalRecord, ClinicalRecordQueryOptions, Correlation, CorrelationInput, CorrelationQueryOptions, DeleteObjectsOptions, ElectrocardiogramQueryOptions, ElectrocardiogramSample, ActivitySummary, ActivitySummaryQueryOptions, AudiogramSample, DateRangeQueryOptions, HealthUpdateEvent, HealthUpdateListener, HeartbeatSeriesQueryOptions, HeartbeatSeriesSample, QuantityQueryOptions, QuantitySample, SampleQueryOptions, QuantitySampleInput, Statistics, StatisticsCollectionQueryOptions, StatisticsQueryOptions, WorkoutInput, WorkoutQueryOptions, WorkoutRoute, WorkoutRouteQueryOptions, WorkoutSample } from './types';
|
|
3
3
|
export * from './identifiers';
|
|
4
4
|
export * from './errors';
|
|
5
5
|
export type * from './types';
|
|
@@ -35,12 +35,19 @@ export declare function disableBackgroundDelivery(type: string): Promise<boolean
|
|
|
35
35
|
export declare function disableAllBackgroundDelivery(): Promise<boolean>;
|
|
36
36
|
export declare function observe(types: readonly string[]): Promise<void>;
|
|
37
37
|
export declare function clearObservers(): Promise<void>;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Types currently registered with `observe`. Persisted natively on iOS, so it
|
|
40
|
+
* reflects observers re-registered at cold launch too.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getObservedTypes(): Promise<string[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Subscribe to observer / background-delivery updates. Return a promise from the
|
|
45
|
+
* listener to hold the iOS completion handler until your async work is done.
|
|
46
|
+
*/
|
|
47
|
+
export declare function addUpdateListener(listener: HealthUpdateListener): {
|
|
41
48
|
remove(): void;
|
|
42
49
|
};
|
|
43
|
-
export declare function useHealthKitUpdates():
|
|
50
|
+
export declare function useHealthKitUpdates(): HealthUpdateEvent | null;
|
|
44
51
|
declare const HealthKit: {
|
|
45
52
|
isAvailable: typeof isAvailable;
|
|
46
53
|
requestAuthorization: typeof requestAuthorization;
|
|
@@ -74,6 +81,7 @@ declare const HealthKit: {
|
|
|
74
81
|
disableAllBackgroundDelivery: typeof disableAllBackgroundDelivery;
|
|
75
82
|
observe: typeof observe;
|
|
76
83
|
clearObservers: typeof clearObservers;
|
|
84
|
+
getObservedTypes: typeof getObservedTypes;
|
|
77
85
|
addUpdateListener: typeof addUpdateListener;
|
|
78
86
|
useHealthKitUpdates: typeof useHealthKitUpdates;
|
|
79
87
|
QuantityType: {
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,SAAS,EAWT,mBAAmB,EAKnB,eAAe,EACf,aAAa,EAGd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,6BAA6B,EAC7B,uBAAuB,EACvB,eAAe,EACf,2BAA2B,EAC3B,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,SAAS,EAWT,mBAAmB,EAKnB,eAAe,EACf,aAAa,EAGd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Dd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import ExpoHealthKitModule from './ExpoHealthKitModule';
|
|
4
4
|
import { fromIso, resolveEndDate, toIso, toOptionalIso } from './dates';
|
|
@@ -349,11 +349,68 @@ export async function clearObservers() {
|
|
|
349
349
|
assertAvailable();
|
|
350
350
|
await ExpoHealthKitModule.clearObserverQueries();
|
|
351
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* Types currently registered with `observe`. Persisted natively on iOS, so it
|
|
354
|
+
* reflects observers re-registered at cold launch too.
|
|
355
|
+
*/
|
|
356
|
+
export async function getObservedTypes() {
|
|
357
|
+
if (!isAvailable())
|
|
358
|
+
return [];
|
|
359
|
+
return ExpoHealthKitModule.getObservedTypes();
|
|
360
|
+
}
|
|
361
|
+
const updateListeners = new Set();
|
|
362
|
+
let nativeUpdateSubscription = null;
|
|
363
|
+
function runListener(listener, event) {
|
|
364
|
+
try {
|
|
365
|
+
return Promise.resolve(listener(event));
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
return Promise.reject(error);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function handleNativeUpdate(nativeEvent) {
|
|
372
|
+
const { token, type } = nativeEvent;
|
|
373
|
+
const event = { type };
|
|
374
|
+
const results = [...updateListeners].map((listener) => runListener(listener, event));
|
|
375
|
+
Promise.allSettled(results).then((settled) => {
|
|
376
|
+
if (__DEV__) {
|
|
377
|
+
for (const result of settled) {
|
|
378
|
+
if (result.status === 'rejected') {
|
|
379
|
+
console.warn('[expo-healthkit] update listener threw', result.reason);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (token) {
|
|
384
|
+
ExpoHealthKitModule.completeUpdate(token).catch(() => { });
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Subscribe to observer / background-delivery updates. Return a promise from the
|
|
390
|
+
* listener to hold the iOS completion handler until your async work is done.
|
|
391
|
+
*/
|
|
352
392
|
export function addUpdateListener(listener) {
|
|
353
|
-
|
|
393
|
+
updateListeners.add(listener);
|
|
394
|
+
if (!nativeUpdateSubscription) {
|
|
395
|
+
nativeUpdateSubscription = ExpoHealthKitModule.addListener('onUpdate', handleNativeUpdate);
|
|
396
|
+
}
|
|
397
|
+
return {
|
|
398
|
+
remove() {
|
|
399
|
+
updateListeners.delete(listener);
|
|
400
|
+
if (updateListeners.size === 0 && nativeUpdateSubscription) {
|
|
401
|
+
nativeUpdateSubscription.remove();
|
|
402
|
+
nativeUpdateSubscription = null;
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
};
|
|
354
406
|
}
|
|
355
407
|
export function useHealthKitUpdates() {
|
|
356
|
-
|
|
408
|
+
const [event, setEvent] = useState(null);
|
|
409
|
+
useEffect(() => {
|
|
410
|
+
const subscription = addUpdateListener((next) => setEvent(next));
|
|
411
|
+
return () => subscription.remove();
|
|
412
|
+
}, []);
|
|
413
|
+
return event;
|
|
357
414
|
}
|
|
358
415
|
const HealthKit = {
|
|
359
416
|
isAvailable,
|
|
@@ -388,6 +445,7 @@ const HealthKit = {
|
|
|
388
445
|
disableAllBackgroundDelivery,
|
|
389
446
|
observe,
|
|
390
447
|
clearObservers,
|
|
448
|
+
getObservedTypes,
|
|
391
449
|
addUpdateListener,
|
|
392
450
|
useHealthKitUpdates,
|
|
393
451
|
QuantityType,
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
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CAAC;AACnD,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,WAAW;IACX,oBAAoB;IACpB,sBAAsB;IACtB,gCAAgC;IAChC,oBAAoB;IACpB,oBAAoB;IACpB,aAAa;IACb,uBAAuB;IACvB,sBAAsB;IACtB,oBAAoB;IACpB,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,oBAAoB;IACpB,eAAe;IACf,yBAAyB;IACzB,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,WAAW;IACX,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,sBAAsB;IACtB,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;IACzB,4BAA4B;IAC5B,OAAO;IACP,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,YAAY;IACZ,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,WAAW;IACX,qBAAqB;IACrB,aAAa;IACb,UAAU;IACV,mBAAmB;IACnB,YAAY;IACZ,IAAI;IACJ,mBAAmB;IACnB,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,mBAAmB;IACnB,0BAA0B;IAC1B,aAAa;IACb,SAAS;IACT,mBAAmB;IACnB,aAAa;IACb,+BAA+B;IAC/B,+BAA+B;CAChC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useEvent } from 'expo';\nimport { Platform } from 'react-native';\n\nimport ExpoHealthKitModule from './ExpoHealthKitModule';\nimport { fromIso, resolveEndDate, toIso, toOptionalIso } from './dates';\nimport { HealthKitUnavailableError } from './errors';\nimport {\n AuthorizationRequestStatus,\n AuthorizationStatus,\n BiologicalSex,\n BloodType,\n CategoryType,\n CharacteristicType,\n ClinicalType,\n CorrelationType,\n ElectrocardiogramClassification,\n ElectrocardiogramSymptomsStatus,\n ElectrocardiogramType,\n AudiogramType,\n ActivitySummaryType,\n SeriesType,\n FitzpatrickSkinType,\n QuantityType,\n SleepAnalysisValue,\n StatisticsOption,\n Unit,\n UpdateFrequency,\n WheelchairUse,\n WorkoutActivityType,\n WorkoutType,\n} from './identifiers';\nimport type {\n AnchoredQueryOptions,\n AnchoredQueryResult,\n AuthorizationOptions,\n CategorySample,\n CategorySampleInput,\n ClinicalRecord,\n ClinicalRecordQueryOptions,\n Correlation,\n CorrelationInput,\n CorrelationQueryOptions,\n DeleteObjectsOptions,\n ElectrocardiogramQueryOptions,\n ElectrocardiogramSample,\n ActivitySummary,\n ActivitySummaryQueryOptions,\n AudiogramSample,\n DateRangeQueryOptions,\n HeartbeatSeriesQueryOptions,\n HeartbeatSeriesSample,\n QuantityQueryOptions,\n QuantitySample,\n SampleQueryOptions,\n QuantitySampleInput,\n Statistics,\n StatisticsCollectionQueryOptions,\n StatisticsQueryOptions,\n WorkoutInput,\n WorkoutQueryOptions,\n WorkoutRoute,\n WorkoutRouteQueryOptions,\n WorkoutSample,\n} from './types';\n\nexport * from './identifiers';\nexport * from './errors';\nexport type * from './types';\n\nconst HK_UNLIMITED = 0;\n\nfunction isHealthPlatform(): boolean {\n return Platform.OS === 'ios' || Platform.OS === 'android';\n}\n\nfunction assertAvailable(): void {\n if (!isHealthPlatform() || !ExpoHealthKitModule.isHealthDataAvailable()) {\n throw new HealthKitUnavailableError();\n }\n}\n\nexport function isAvailable(): boolean {\n return isHealthPlatform() && ExpoHealthKitModule.isHealthDataAvailable();\n}\n\nexport async function requestAuthorization(options: AuthorizationOptions = {}): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.requestAuthorization({\n toRead: [...(options.toRead ?? [])],\n toShare: [...(options.toShare ?? [])],\n });\n}\n\nexport async function getAuthorizationStatus(type: string): Promise<AuthorizationStatus> {\n assertAvailable();\n return (await ExpoHealthKitModule.getAuthorizationStatus(type)) as AuthorizationStatus;\n}\n\nexport async function getRequestStatusForAuthorization(\n options: AuthorizationOptions = {}\n): Promise<AuthorizationRequestStatus> {\n assertAvailable();\n return (await ExpoHealthKitModule.getRequestStatusForAuthorization({\n toRead: [...(options.toRead ?? [])],\n toShare: [...(options.toShare ?? [])],\n })) as AuthorizationRequestStatus;\n}\n\nexport async function queryQuantitySamples(\n options: QuantityQueryOptions\n): Promise<QuantitySample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryQuantitySamples({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryCategorySamples(options: SampleQueryOptions): Promise<CategorySample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryCategorySamples({\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryWorkouts(options: WorkoutQueryOptions = {}): Promise<WorkoutSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryWorkouts({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n activityType: options.activityType,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n workoutActivityType: sample.workoutActivityType as WorkoutSample['workoutActivityType'],\n }));\n}\n\nexport async function queryElectrocardiograms(\n options: ElectrocardiogramQueryOptions = {}\n): Promise<ElectrocardiogramSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryElectrocardiograms({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n includeVoltage: options.includeVoltage ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n classification: sample.classification as ElectrocardiogramSample['classification'],\n symptomsStatus: sample.symptomsStatus as ElectrocardiogramSample['symptomsStatus'],\n }));\n}\n\nexport async function queryActivitySummaries(\n options: ActivitySummaryQueryOptions = {}\n): Promise<ActivitySummary[]> {\n assertAvailable();\n return ExpoHealthKitModule.queryActivitySummaries({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n });\n}\n\nexport async function queryClinicalRecords(\n options: ClinicalRecordQueryOptions\n): Promise<ClinicalRecord[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryClinicalRecords({\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryAudiograms(\n options: DateRangeQueryOptions = {}\n): Promise<AudiogramSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryAudiograms({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryWorkoutRoute(\n options: WorkoutRouteQueryOptions\n): Promise<WorkoutRoute[]> {\n assertAvailable();\n const routes = await ExpoHealthKitModule.queryWorkoutRoute({\n workoutUUID: options.workoutUUID,\n });\n\n return routes.map((route) => ({\n ...route,\n startDate: fromIso(route.startDate),\n endDate: fromIso(route.endDate),\n locations: route.locations.map((location) => ({\n ...location,\n timestamp: fromIso(location.timestamp),\n })),\n }));\n}\n\nfunction mapQuantitySample(sample: {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n value: number;\n unit: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}) {\n return {\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n };\n}\n\nexport async function queryCorrelations(options: CorrelationQueryOptions): Promise<Correlation[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryCorrelations({\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n objects: sample.objects.map(mapQuantitySample),\n }));\n}\n\nexport async function queryHeartbeatSeries(\n options: HeartbeatSeriesQueryOptions = {}\n): Promise<HeartbeatSeriesSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryHeartbeatSeries({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n includeBeats: options.includeBeats ?? true,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryStatistics(options: StatisticsQueryOptions): Promise<Statistics> {\n assertAvailable();\n const stats = await ExpoHealthKitModule.queryStatistics({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n options: options.options ?? 0,\n });\n\n return {\n ...stats,\n startDate: fromIso(stats.startDate),\n endDate: fromIso(stats.endDate),\n };\n}\n\nexport async function queryStatisticsCollection(\n options: StatisticsCollectionQueryOptions\n): Promise<Statistics[]> {\n assertAvailable();\n const interval = options.interval ?? { day: 1 };\n const results = await ExpoHealthKitModule.queryStatisticsCollection({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n options: options.options ?? 0,\n year: interval.year ?? 0,\n month: interval.month ?? 0,\n day: interval.day ?? 0,\n hour: interval.hour ?? 0,\n minute: interval.minute ?? 0,\n second: interval.second ?? 0,\n });\n\n return results.map((stats) => ({\n ...stats,\n startDate: fromIso(stats.startDate),\n endDate: fromIso(stats.endDate),\n }));\n}\n\nexport async function queryAnchored(options: AnchoredQueryOptions): Promise<AnchoredQueryResult> {\n assertAvailable();\n const result = await ExpoHealthKitModule.queryAnchored({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n anchor: options.anchor ?? undefined,\n });\n\n return {\n added: result.added.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n })),\n deleted: result.deleted,\n anchor: result.anchor ?? null,\n };\n}\n\nexport async function saveQuantitySample(sample: QuantitySampleInput): Promise<string> {\n assertAvailable();\n return ExpoHealthKitModule.saveQuantitySample({\n type: sample.type,\n unit: sample.unit,\n value: sample.value,\n startDate: toIso(sample.startDate),\n endDate: resolveEndDate(sample.startDate, sample.endDate),\n metadata: sample.metadata,\n });\n}\n\nexport async function saveCategorySample(sample: CategorySampleInput): Promise<string> {\n assertAvailable();\n return ExpoHealthKitModule.saveCategorySample({\n type: sample.type,\n value: sample.value,\n startDate: toIso(sample.startDate),\n endDate: resolveEndDate(sample.startDate, sample.endDate),\n metadata: sample.metadata,\n });\n}\n\nexport async function saveWorkout(workout: WorkoutInput): Promise<string> {\n assertAvailable();\n return ExpoHealthKitModule.saveWorkout({\n activityType: workout.activityType,\n startDate: toIso(workout.startDate),\n endDate: toIso(workout.endDate),\n energyBurned: workout.energyBurned,\n energyBurnedUnit: workout.energyBurnedUnit,\n distance: workout.distance,\n distanceUnit: workout.distanceUnit,\n metadata: workout.metadata,\n });\n}\n\nexport async function saveCorrelation(correlation: CorrelationInput): Promise<string> {\n assertAvailable();\n const startDate = toIso(correlation.startDate);\n const endDate = resolveEndDate(correlation.startDate, correlation.endDate);\n return ExpoHealthKitModule.saveCorrelation({\n type: correlation.type,\n startDate,\n endDate,\n objects: correlation.objects.map((object) => ({\n type: object.type,\n unit: object.unit,\n value: object.value,\n startDate: toIso(object.startDate ?? correlation.startDate),\n endDate: resolveEndDate(\n object.endDate ?? object.startDate ?? correlation.startDate,\n object.endDate ?? correlation.endDate\n ),\n metadata: object.metadata,\n })),\n metadata: correlation.metadata,\n });\n}\n\nexport async function deleteObjects(options: DeleteObjectsOptions): Promise<number> {\n assertAvailable();\n return ExpoHealthKitModule.deleteObjects({\n uuid: options.uuid,\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n });\n}\n\nexport async function getBiologicalSex(): Promise<BiologicalSex> {\n assertAvailable();\n return (await ExpoHealthKitModule.getBiologicalSex()) as BiologicalSex;\n}\n\nexport async function getBloodType(): Promise<BloodType> {\n assertAvailable();\n return (await ExpoHealthKitModule.getBloodType()) as BloodType;\n}\n\nexport async function getDateOfBirth(): Promise<Date | null> {\n assertAvailable();\n const value = await ExpoHealthKitModule.getDateOfBirth();\n return value ? fromIso(value) : null;\n}\n\nexport async function getFitzpatrickSkinType(): Promise<FitzpatrickSkinType> {\n assertAvailable();\n return (await ExpoHealthKitModule.getFitzpatrickSkinType()) as FitzpatrickSkinType;\n}\n\nexport async function getWheelchairUse(): Promise<WheelchairUse> {\n assertAvailable();\n return (await ExpoHealthKitModule.getWheelchairUse()) as WheelchairUse;\n}\n\nexport async function enableBackgroundDelivery(\n type: string,\n frequency: UpdateFrequency\n): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.enableBackgroundDelivery(type, frequency);\n}\n\nexport async function disableBackgroundDelivery(type: string): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.disableBackgroundDelivery(type);\n}\n\nexport async function disableAllBackgroundDelivery(): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.disableAllBackgroundDelivery();\n}\n\nexport async function observe(types: readonly string[]): Promise<void> {\n assertAvailable();\n await ExpoHealthKitModule.observeTypes([...types]);\n}\n\nexport async function clearObservers(): Promise<void> {\n assertAvailable();\n await ExpoHealthKitModule.clearObserverQueries();\n}\n\nexport function addUpdateListener(listener: (event: { type: string }) => void): { remove(): void } {\n return ExpoHealthKitModule.addListener('onUpdate', listener);\n}\n\nexport function useHealthKitUpdates() {\n return useEvent(ExpoHealthKitModule, 'onUpdate');\n}\n\nconst HealthKit = {\n isAvailable,\n requestAuthorization,\n getAuthorizationStatus,\n getRequestStatusForAuthorization,\n queryQuantitySamples,\n queryCategorySamples,\n queryWorkouts,\n queryElectrocardiograms,\n queryActivitySummaries,\n queryClinicalRecords,\n queryAudiograms,\n queryWorkoutRoute,\n queryCorrelations,\n queryHeartbeatSeries,\n queryStatistics,\n queryStatisticsCollection,\n queryAnchored,\n saveQuantitySample,\n saveCategorySample,\n saveWorkout,\n saveCorrelation,\n deleteObjects,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getWheelchairUse,\n enableBackgroundDelivery,\n disableBackgroundDelivery,\n disableAllBackgroundDelivery,\n observe,\n clearObservers,\n addUpdateListener,\n useHealthKitUpdates,\n QuantityType,\n CategoryType,\n CharacteristicType,\n CorrelationType,\n WorkoutType,\n ElectrocardiogramType,\n AudiogramType,\n SeriesType,\n ActivitySummaryType,\n ClinicalType,\n Unit,\n WorkoutActivityType,\n SleepAnalysisValue,\n UpdateFrequency,\n StatisticsOption,\n AuthorizationStatus,\n AuthorizationRequestStatus,\n BiologicalSex,\n BloodType,\n FitzpatrickSkinType,\n WheelchairUse,\n ElectrocardiogramClassification,\n ElectrocardiogramSymptomsStatus,\n};\n\nexport default HealthKit;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EA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AAa;IACb,+BAA+B;IAC/B,+BAA+B;CAChC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport ExpoHealthKitModule from './ExpoHealthKitModule';\nimport { fromIso, resolveEndDate, toIso, toOptionalIso } from './dates';\nimport { HealthKitUnavailableError } from './errors';\nimport {\n AuthorizationRequestStatus,\n AuthorizationStatus,\n BiologicalSex,\n BloodType,\n CategoryType,\n CharacteristicType,\n ClinicalType,\n CorrelationType,\n ElectrocardiogramClassification,\n ElectrocardiogramSymptomsStatus,\n ElectrocardiogramType,\n AudiogramType,\n ActivitySummaryType,\n SeriesType,\n FitzpatrickSkinType,\n QuantityType,\n SleepAnalysisValue,\n StatisticsOption,\n Unit,\n UpdateFrequency,\n WheelchairUse,\n WorkoutActivityType,\n WorkoutType,\n} from './identifiers';\nimport type {\n AnchoredQueryOptions,\n AnchoredQueryResult,\n AuthorizationOptions,\n CategorySample,\n CategorySampleInput,\n ClinicalRecord,\n ClinicalRecordQueryOptions,\n Correlation,\n CorrelationInput,\n CorrelationQueryOptions,\n DeleteObjectsOptions,\n ElectrocardiogramQueryOptions,\n ElectrocardiogramSample,\n ActivitySummary,\n ActivitySummaryQueryOptions,\n AudiogramSample,\n DateRangeQueryOptions,\n HealthUpdateEvent,\n HealthUpdateListener,\n HeartbeatSeriesQueryOptions,\n HeartbeatSeriesSample,\n NativeHealthUpdateEvent,\n QuantityQueryOptions,\n QuantitySample,\n SampleQueryOptions,\n QuantitySampleInput,\n Statistics,\n StatisticsCollectionQueryOptions,\n StatisticsQueryOptions,\n WorkoutInput,\n WorkoutQueryOptions,\n WorkoutRoute,\n WorkoutRouteQueryOptions,\n WorkoutSample,\n} from './types';\n\nexport * from './identifiers';\nexport * from './errors';\nexport type * from './types';\n\nconst HK_UNLIMITED = 0;\n\nfunction isHealthPlatform(): boolean {\n return Platform.OS === 'ios' || Platform.OS === 'android';\n}\n\nfunction assertAvailable(): void {\n if (!isHealthPlatform() || !ExpoHealthKitModule.isHealthDataAvailable()) {\n throw new HealthKitUnavailableError();\n }\n}\n\nexport function isAvailable(): boolean {\n return isHealthPlatform() && ExpoHealthKitModule.isHealthDataAvailable();\n}\n\nexport async function requestAuthorization(options: AuthorizationOptions = {}): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.requestAuthorization({\n toRead: [...(options.toRead ?? [])],\n toShare: [...(options.toShare ?? [])],\n });\n}\n\nexport async function getAuthorizationStatus(type: string): Promise<AuthorizationStatus> {\n assertAvailable();\n return (await ExpoHealthKitModule.getAuthorizationStatus(type)) as AuthorizationStatus;\n}\n\nexport async function getRequestStatusForAuthorization(\n options: AuthorizationOptions = {}\n): Promise<AuthorizationRequestStatus> {\n assertAvailable();\n return (await ExpoHealthKitModule.getRequestStatusForAuthorization({\n toRead: [...(options.toRead ?? [])],\n toShare: [...(options.toShare ?? [])],\n })) as AuthorizationRequestStatus;\n}\n\nexport async function queryQuantitySamples(\n options: QuantityQueryOptions\n): Promise<QuantitySample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryQuantitySamples({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryCategorySamples(options: SampleQueryOptions): Promise<CategorySample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryCategorySamples({\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryWorkouts(options: WorkoutQueryOptions = {}): Promise<WorkoutSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryWorkouts({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n activityType: options.activityType,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n workoutActivityType: sample.workoutActivityType as WorkoutSample['workoutActivityType'],\n }));\n}\n\nexport async function queryElectrocardiograms(\n options: ElectrocardiogramQueryOptions = {}\n): Promise<ElectrocardiogramSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryElectrocardiograms({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n includeVoltage: options.includeVoltage ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n classification: sample.classification as ElectrocardiogramSample['classification'],\n symptomsStatus: sample.symptomsStatus as ElectrocardiogramSample['symptomsStatus'],\n }));\n}\n\nexport async function queryActivitySummaries(\n options: ActivitySummaryQueryOptions = {}\n): Promise<ActivitySummary[]> {\n assertAvailable();\n return ExpoHealthKitModule.queryActivitySummaries({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n });\n}\n\nexport async function queryClinicalRecords(\n options: ClinicalRecordQueryOptions\n): Promise<ClinicalRecord[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryClinicalRecords({\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryAudiograms(\n options: DateRangeQueryOptions = {}\n): Promise<AudiogramSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryAudiograms({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryWorkoutRoute(\n options: WorkoutRouteQueryOptions\n): Promise<WorkoutRoute[]> {\n assertAvailable();\n const routes = await ExpoHealthKitModule.queryWorkoutRoute({\n workoutUUID: options.workoutUUID,\n });\n\n return routes.map((route) => ({\n ...route,\n startDate: fromIso(route.startDate),\n endDate: fromIso(route.endDate),\n locations: route.locations.map((location) => ({\n ...location,\n timestamp: fromIso(location.timestamp),\n })),\n }));\n}\n\nfunction mapQuantitySample(sample: {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n value: number;\n unit: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}) {\n return {\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n };\n}\n\nexport async function queryCorrelations(options: CorrelationQueryOptions): Promise<Correlation[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryCorrelations({\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n objects: sample.objects.map(mapQuantitySample),\n }));\n}\n\nexport async function queryHeartbeatSeries(\n options: HeartbeatSeriesQueryOptions = {}\n): Promise<HeartbeatSeriesSample[]> {\n assertAvailable();\n const samples = await ExpoHealthKitModule.queryHeartbeatSeries({\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n ascending: options.ascending ?? false,\n includeBeats: options.includeBeats ?? true,\n });\n\n return samples.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n }));\n}\n\nexport async function queryStatistics(options: StatisticsQueryOptions): Promise<Statistics> {\n assertAvailable();\n const stats = await ExpoHealthKitModule.queryStatistics({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n options: options.options ?? 0,\n });\n\n return {\n ...stats,\n startDate: fromIso(stats.startDate),\n endDate: fromIso(stats.endDate),\n };\n}\n\nexport async function queryStatisticsCollection(\n options: StatisticsCollectionQueryOptions\n): Promise<Statistics[]> {\n assertAvailable();\n const interval = options.interval ?? { day: 1 };\n const results = await ExpoHealthKitModule.queryStatisticsCollection({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n options: options.options ?? 0,\n year: interval.year ?? 0,\n month: interval.month ?? 0,\n day: interval.day ?? 0,\n hour: interval.hour ?? 0,\n minute: interval.minute ?? 0,\n second: interval.second ?? 0,\n });\n\n return results.map((stats) => ({\n ...stats,\n startDate: fromIso(stats.startDate),\n endDate: fromIso(stats.endDate),\n }));\n}\n\nexport async function queryAnchored(options: AnchoredQueryOptions): Promise<AnchoredQueryResult> {\n assertAvailable();\n const result = await ExpoHealthKitModule.queryAnchored({\n type: options.type,\n unit: options.unit,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n limit: options.limit ?? HK_UNLIMITED,\n anchor: options.anchor ?? undefined,\n });\n\n return {\n added: result.added.map((sample) => ({\n ...sample,\n startDate: fromIso(sample.startDate),\n endDate: fromIso(sample.endDate),\n })),\n deleted: result.deleted,\n anchor: result.anchor ?? null,\n };\n}\n\nexport async function saveQuantitySample(sample: QuantitySampleInput): Promise<string> {\n assertAvailable();\n return ExpoHealthKitModule.saveQuantitySample({\n type: sample.type,\n unit: sample.unit,\n value: sample.value,\n startDate: toIso(sample.startDate),\n endDate: resolveEndDate(sample.startDate, sample.endDate),\n metadata: sample.metadata,\n });\n}\n\nexport async function saveCategorySample(sample: CategorySampleInput): Promise<string> {\n assertAvailable();\n return ExpoHealthKitModule.saveCategorySample({\n type: sample.type,\n value: sample.value,\n startDate: toIso(sample.startDate),\n endDate: resolveEndDate(sample.startDate, sample.endDate),\n metadata: sample.metadata,\n });\n}\n\nexport async function saveWorkout(workout: WorkoutInput): Promise<string> {\n assertAvailable();\n return ExpoHealthKitModule.saveWorkout({\n activityType: workout.activityType,\n startDate: toIso(workout.startDate),\n endDate: toIso(workout.endDate),\n energyBurned: workout.energyBurned,\n energyBurnedUnit: workout.energyBurnedUnit,\n distance: workout.distance,\n distanceUnit: workout.distanceUnit,\n metadata: workout.metadata,\n });\n}\n\nexport async function saveCorrelation(correlation: CorrelationInput): Promise<string> {\n assertAvailable();\n const startDate = toIso(correlation.startDate);\n const endDate = resolveEndDate(correlation.startDate, correlation.endDate);\n return ExpoHealthKitModule.saveCorrelation({\n type: correlation.type,\n startDate,\n endDate,\n objects: correlation.objects.map((object) => ({\n type: object.type,\n unit: object.unit,\n value: object.value,\n startDate: toIso(object.startDate ?? correlation.startDate),\n endDate: resolveEndDate(\n object.endDate ?? object.startDate ?? correlation.startDate,\n object.endDate ?? correlation.endDate\n ),\n metadata: object.metadata,\n })),\n metadata: correlation.metadata,\n });\n}\n\nexport async function deleteObjects(options: DeleteObjectsOptions): Promise<number> {\n assertAvailable();\n return ExpoHealthKitModule.deleteObjects({\n uuid: options.uuid,\n type: options.type,\n from: toOptionalIso(options.from),\n to: toOptionalIso(options.to),\n });\n}\n\nexport async function getBiologicalSex(): Promise<BiologicalSex> {\n assertAvailable();\n return (await ExpoHealthKitModule.getBiologicalSex()) as BiologicalSex;\n}\n\nexport async function getBloodType(): Promise<BloodType> {\n assertAvailable();\n return (await ExpoHealthKitModule.getBloodType()) as BloodType;\n}\n\nexport async function getDateOfBirth(): Promise<Date | null> {\n assertAvailable();\n const value = await ExpoHealthKitModule.getDateOfBirth();\n return value ? fromIso(value) : null;\n}\n\nexport async function getFitzpatrickSkinType(): Promise<FitzpatrickSkinType> {\n assertAvailable();\n return (await ExpoHealthKitModule.getFitzpatrickSkinType()) as FitzpatrickSkinType;\n}\n\nexport async function getWheelchairUse(): Promise<WheelchairUse> {\n assertAvailable();\n return (await ExpoHealthKitModule.getWheelchairUse()) as WheelchairUse;\n}\n\nexport async function enableBackgroundDelivery(\n type: string,\n frequency: UpdateFrequency\n): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.enableBackgroundDelivery(type, frequency);\n}\n\nexport async function disableBackgroundDelivery(type: string): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.disableBackgroundDelivery(type);\n}\n\nexport async function disableAllBackgroundDelivery(): Promise<boolean> {\n assertAvailable();\n return ExpoHealthKitModule.disableAllBackgroundDelivery();\n}\n\nexport async function observe(types: readonly string[]): Promise<void> {\n assertAvailable();\n await ExpoHealthKitModule.observeTypes([...types]);\n}\n\nexport async function clearObservers(): Promise<void> {\n assertAvailable();\n await ExpoHealthKitModule.clearObserverQueries();\n}\n\n/**\n * Types currently registered with `observe`. Persisted natively on iOS, so it\n * reflects observers re-registered at cold launch too.\n */\nexport async function getObservedTypes(): Promise<string[]> {\n if (!isAvailable()) return [];\n return ExpoHealthKitModule.getObservedTypes();\n}\n\nconst updateListeners = new Set<HealthUpdateListener>();\nlet nativeUpdateSubscription: { remove(): void } | null = null;\n\nfunction runListener(listener: HealthUpdateListener, event: HealthUpdateEvent): Promise<void> {\n try {\n return Promise.resolve(listener(event));\n } catch (error) {\n return Promise.reject(error);\n }\n}\n\nfunction handleNativeUpdate(nativeEvent: NativeHealthUpdateEvent): void {\n const { token, type } = nativeEvent;\n const event: HealthUpdateEvent = { type };\n const results = [...updateListeners].map((listener) => runListener(listener, event));\n\n Promise.allSettled(results).then((settled) => {\n if (__DEV__) {\n for (const result of settled) {\n if (result.status === 'rejected') {\n console.warn('[expo-healthkit] update listener threw', result.reason);\n }\n }\n }\n if (token) {\n ExpoHealthKitModule.completeUpdate(token).catch(() => {});\n }\n });\n}\n\n/**\n * Subscribe to observer / background-delivery updates. Return a promise from the\n * listener to hold the iOS completion handler until your async work is done.\n */\nexport function addUpdateListener(listener: HealthUpdateListener): { remove(): void } {\n updateListeners.add(listener);\n if (!nativeUpdateSubscription) {\n nativeUpdateSubscription = ExpoHealthKitModule.addListener('onUpdate', handleNativeUpdate);\n }\n\n return {\n remove() {\n updateListeners.delete(listener);\n if (updateListeners.size === 0 && nativeUpdateSubscription) {\n nativeUpdateSubscription.remove();\n nativeUpdateSubscription = null;\n }\n },\n };\n}\n\nexport function useHealthKitUpdates(): HealthUpdateEvent | null {\n const [event, setEvent] = useState<HealthUpdateEvent | null>(null);\n\n useEffect(() => {\n const subscription = addUpdateListener((next) => setEvent(next));\n return () => subscription.remove();\n }, []);\n\n return event;\n}\n\nconst HealthKit = {\n isAvailable,\n requestAuthorization,\n getAuthorizationStatus,\n getRequestStatusForAuthorization,\n queryQuantitySamples,\n queryCategorySamples,\n queryWorkouts,\n queryElectrocardiograms,\n queryActivitySummaries,\n queryClinicalRecords,\n queryAudiograms,\n queryWorkoutRoute,\n queryCorrelations,\n queryHeartbeatSeries,\n queryStatistics,\n queryStatisticsCollection,\n queryAnchored,\n saveQuantitySample,\n saveCategorySample,\n saveWorkout,\n saveCorrelation,\n deleteObjects,\n getBiologicalSex,\n getBloodType,\n getDateOfBirth,\n getFitzpatrickSkinType,\n getWheelchairUse,\n enableBackgroundDelivery,\n disableBackgroundDelivery,\n disableAllBackgroundDelivery,\n observe,\n clearObservers,\n getObservedTypes,\n addUpdateListener,\n useHealthKitUpdates,\n QuantityType,\n CategoryType,\n CharacteristicType,\n CorrelationType,\n WorkoutType,\n ElectrocardiogramType,\n AudiogramType,\n SeriesType,\n ActivitySummaryType,\n ClinicalType,\n Unit,\n WorkoutActivityType,\n SleepAnalysisValue,\n UpdateFrequency,\n StatisticsOption,\n AuthorizationStatus,\n AuthorizationRequestStatus,\n BiologicalSex,\n BloodType,\n FitzpatrickSkinType,\n WheelchairUse,\n ElectrocardiogramClassification,\n ElectrocardiogramSymptomsStatus,\n};\n\nexport default HealthKit;\n"]}
|
package/build/types.d.ts
CHANGED
|
@@ -272,8 +272,18 @@ export interface AnchoredQueryResult {
|
|
|
272
272
|
export interface HealthUpdateEvent {
|
|
273
273
|
type: string;
|
|
274
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Return a promise to keep the app alive (and the HealthKit completion handler
|
|
277
|
+
* pending) until your async work finishes. Resolves are awaited across all
|
|
278
|
+
* listeners; native times out after ~25s regardless.
|
|
279
|
+
*/
|
|
280
|
+
export type HealthUpdateListener = (event: HealthUpdateEvent) => void | Promise<void>;
|
|
281
|
+
export interface NativeHealthUpdateEvent extends HealthUpdateEvent {
|
|
282
|
+
/** Present on iOS. Passed back via `completeUpdate` once listeners finish. */
|
|
283
|
+
token?: string;
|
|
284
|
+
}
|
|
275
285
|
export type ExpoHealthKitModuleEvents = {
|
|
276
|
-
onUpdate: (event:
|
|
286
|
+
onUpdate: (event: NativeHealthUpdateEvent) => void;
|
|
277
287
|
};
|
|
278
288
|
export interface NativeAuthorizationOptions {
|
|
279
289
|
toRead: string[];
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,+BAA+B,EAC/B,UAAU,EACV,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,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AI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC"}
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ClinicalType,\n CorrelationType,\n ElectrocardiogramClassification,\n ElectrocardiogramSymptomsStatus,\n ObjectType,\n WorkoutActivityType,\n} from './identifiers';\n\nexport type DateInput = Date | string;\n\nexport interface AuthorizationOptions {\n toRead?: readonly ObjectType[];\n toShare?: readonly ObjectType[];\n}\n\nexport interface SampleQueryOptions {\n type: ObjectType;\n from?: DateInput;\n to?: DateInput;\n limit?: number;\n ascending?: boolean;\n}\n\nexport interface QuantityQueryOptions extends SampleQueryOptions {\n unit: string;\n}\n\nexport interface WorkoutQueryOptions {\n from?: DateInput;\n to?: DateInput;\n limit?: number;\n ascending?: boolean;\n activityType?: WorkoutActivityType;\n}\n\nexport interface StatisticsQueryOptions {\n type: ObjectType;\n unit: string;\n from?: DateInput;\n to?: DateInput;\n /** Bitmask of `StatisticsOption` values. Combine with bitwise OR. */\n options?: number;\n}\n\nexport interface DateInterval {\n year?: number;\n month?: number;\n day?: number;\n hour?: number;\n minute?: number;\n second?: number;\n}\n\nexport interface StatisticsCollectionQueryOptions extends StatisticsQueryOptions {\n interval?: DateInterval;\n}\n\nexport interface AnchoredQueryOptions extends SampleQueryOptions {\n unit?: string;\n /** Opaque token returned by a previous anchored query. */\n anchor?: string | null;\n}\n\nexport interface QuantitySampleInput {\n type: ObjectType;\n unit: string;\n value: number;\n startDate: DateInput;\n endDate?: DateInput;\n metadata?: Record<string, string>;\n}\n\nexport interface CategorySampleInput {\n type: ObjectType;\n value: number;\n startDate: DateInput;\n endDate?: DateInput;\n metadata?: Record<string, string>;\n}\n\nexport interface WorkoutInput {\n activityType: WorkoutActivityType;\n startDate: DateInput;\n endDate: DateInput;\n energyBurned?: number;\n energyBurnedUnit?: string;\n distance?: number;\n distanceUnit?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface DeleteObjectsOptions {\n uuid?: string;\n type?: ObjectType;\n from?: DateInput;\n to?: DateInput;\n}\n\nexport interface DateRangeQueryOptions {\n from?: DateInput;\n to?: DateInput;\n limit?: number;\n ascending?: boolean;\n}\n\nexport interface ElectrocardiogramQueryOptions extends DateRangeQueryOptions {\n includeVoltage?: boolean;\n}\n\nexport interface ActivitySummaryQueryOptions {\n from?: DateInput;\n to?: DateInput;\n}\n\nexport interface ClinicalRecordQueryOptions extends DateRangeQueryOptions {\n type: ClinicalType | (string & {});\n}\n\nexport interface WorkoutRouteQueryOptions {\n workoutUUID: string;\n}\n\nexport interface CorrelationQueryOptions extends DateRangeQueryOptions {\n type: CorrelationType | (string & {});\n}\n\nexport interface CorrelationObjectInput {\n type: ObjectType;\n unit: string;\n value: number;\n startDate?: DateInput;\n endDate?: DateInput;\n metadata?: Record<string, string>;\n}\n\nexport interface CorrelationInput {\n type: CorrelationType | (string & {});\n startDate: DateInput;\n endDate?: DateInput;\n objects: readonly CorrelationObjectInput[];\n metadata?: Record<string, string>;\n}\n\nexport interface HeartbeatSeriesQueryOptions extends DateRangeQueryOptions {\n /** Default `true`. `false` returns series metadata without beat timestamps. */\n includeBeats?: boolean;\n}\n\nexport interface Correlation {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n objects: QuantitySample[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface Heartbeat {\n timeSinceSeriesStart: number;\n precededByGap: boolean;\n}\n\nexport interface HeartbeatSeriesSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n count: number;\n beats?: Heartbeat[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface QuantitySample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n value: number;\n unit: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface CategorySample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n value: number;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface WorkoutSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n duration: number;\n workoutActivityType: WorkoutActivityType;\n totalEnergyBurned?: number;\n totalEnergyBurnedUnit?: string;\n totalDistance?: number;\n totalDistanceUnit?: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface ElectrocardiogramVoltageMeasurement {\n timeSinceSampleStart: number;\n voltage: number;\n unit: string;\n}\n\nexport interface ElectrocardiogramSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n classification: ElectrocardiogramClassification;\n symptomsStatus: ElectrocardiogramSymptomsStatus;\n averageHeartRate?: number;\n samplingFrequency?: number;\n numberOfVoltageMeasurements: number;\n voltageMeasurements?: ElectrocardiogramVoltageMeasurement[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface AudiogramSensitivityPoint {\n frequency: number;\n leftEarSensitivity?: number;\n rightEarSensitivity?: number;\n}\n\nexport interface AudiogramSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n sensitivityPoints: AudiogramSensitivityPoint[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface ActivitySummary {\n date: string;\n activeEnergyBurned: number;\n appleExerciseTime: number;\n appleStandHours: number;\n activeEnergyBurnedGoal: number;\n appleExerciseTimeGoal: number;\n appleStandHoursGoal: number;\n appleMoveTime?: number;\n appleMoveTimeGoal?: number;\n}\n\nexport interface ClinicalRecord {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n displayName: string;\n fhirResourceType?: string;\n fhirJson?: string;\n sourceName?: string;\n sourceId?: string;\n}\n\nexport interface WorkoutRouteLocation {\n latitude: number;\n longitude: number;\n altitude?: number;\n timestamp: Date;\n speed?: number;\n course?: number;\n}\n\nexport interface WorkoutRoute {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n locations: WorkoutRouteLocation[];\n}\n\nexport interface DeletedSample {\n uuid: string;\n type?: string;\n}\n\nexport interface Statistics {\n startDate: Date;\n endDate: Date;\n unit: string;\n sum?: number;\n min?: number;\n max?: number;\n average?: number;\n mostRecent?: number;\n}\n\nexport interface AnchoredQueryResult {\n added: QuantitySample[];\n deleted: DeletedSample[];\n anchor: string | null;\n}\n\nexport interface HealthUpdateEvent {\n type: string;\n}\n\nexport type ExpoHealthKitModuleEvents = {\n onUpdate: (event: HealthUpdateEvent) => void;\n};\n\nexport interface NativeAuthorizationOptions {\n toRead: string[];\n toShare: string[];\n}\n\nexport interface NativeQuantityQueryOptions {\n type: string;\n unit: string;\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n}\n\nexport interface NativeCategoryQueryOptions {\n type: string;\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n}\n\nexport interface NativeWorkoutQueryOptions {\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n activityType?: number;\n}\n\nexport interface NativeStatisticsQueryOptions {\n type: string;\n unit: string;\n from?: string;\n to?: string;\n options: number;\n}\n\nexport interface NativeStatisticsCollectionQueryOptions extends NativeStatisticsQueryOptions {\n year: number;\n month: number;\n day: number;\n hour: number;\n minute: number;\n second: number;\n}\n\nexport interface NativeAnchoredQueryOptions {\n type: string;\n unit?: string;\n from?: string;\n to?: string;\n limit: number;\n anchor?: string;\n}\n\nexport interface NativeQuantitySampleInput {\n type: string;\n unit: string;\n value: number;\n startDate: string;\n endDate: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeCategorySampleInput {\n type: string;\n value: number;\n startDate: string;\n endDate: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeWorkoutInput {\n activityType: number;\n startDate: string;\n endDate: string;\n energyBurned?: number;\n energyBurnedUnit?: string;\n distance?: number;\n distanceUnit?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeDeleteObjectsOptions {\n uuid?: string;\n type?: string;\n from?: string;\n to?: string;\n}\n\nexport interface NativeQuantitySample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n value: number;\n unit: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeCategorySample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n value: number;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeWorkoutSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n duration: number;\n workoutActivityType: number;\n totalEnergyBurned?: number;\n totalEnergyBurnedUnit?: string;\n totalDistance?: number;\n totalDistanceUnit?: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeDeletedSample {\n uuid: string;\n type?: string;\n}\n\nexport interface NativeStatistics {\n startDate: string;\n endDate: string;\n unit: string;\n sum?: number;\n min?: number;\n max?: number;\n average?: number;\n mostRecent?: number;\n}\n\nexport interface NativeAnchoredQueryResult {\n added: NativeQuantitySample[];\n deleted: NativeDeletedSample[];\n anchor?: string;\n}\n\nexport interface NativeDateRangeQueryOptions {\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n}\n\nexport interface NativeElectrocardiogramQueryOptions extends NativeDateRangeQueryOptions {\n includeVoltage: boolean;\n}\n\nexport interface NativeActivitySummaryQueryOptions {\n from?: string;\n to?: string;\n}\n\nexport interface NativeClinicalRecordQueryOptions extends NativeDateRangeQueryOptions {\n type: string;\n}\n\nexport interface NativeWorkoutRouteQueryOptions {\n workoutUUID: string;\n}\n\nexport interface NativeElectrocardiogramVoltageMeasurement {\n timeSinceSampleStart: number;\n voltage: number;\n unit: string;\n}\n\nexport interface NativeElectrocardiogramSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n classification: number;\n symptomsStatus: number;\n averageHeartRate?: number;\n samplingFrequency?: number;\n numberOfVoltageMeasurements: number;\n voltageMeasurements?: NativeElectrocardiogramVoltageMeasurement[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeAudiogramSensitivityPoint {\n frequency: number;\n leftEarSensitivity?: number;\n rightEarSensitivity?: number;\n}\n\nexport interface NativeAudiogramSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n sensitivityPoints: NativeAudiogramSensitivityPoint[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeActivitySummary {\n date: string;\n activeEnergyBurned: number;\n appleExerciseTime: number;\n appleStandHours: number;\n activeEnergyBurnedGoal: number;\n appleExerciseTimeGoal: number;\n appleStandHoursGoal: number;\n appleMoveTime?: number;\n appleMoveTimeGoal?: number;\n}\n\nexport interface NativeClinicalRecord {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n displayName: string;\n fhirResourceType?: string;\n fhirJson?: string;\n sourceName?: string;\n sourceId?: string;\n}\n\nexport interface NativeWorkoutRouteLocation {\n latitude: number;\n longitude: number;\n altitude?: number;\n timestamp: string;\n speed?: number;\n course?: number;\n}\n\nexport interface NativeWorkoutRoute {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n locations: NativeWorkoutRouteLocation[];\n}\n\nexport interface NativeCorrelationQueryOptions extends NativeDateRangeQueryOptions {\n type: string;\n}\n\nexport interface NativeCorrelationInput {\n type: string;\n startDate: string;\n endDate: string;\n objects: NativeQuantitySampleInput[];\n metadata?: Record<string, string>;\n}\n\nexport interface NativeHeartbeatSeriesQueryOptions extends NativeDateRangeQueryOptions {\n includeBeats: boolean;\n}\n\nexport interface NativeCorrelation {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n objects: NativeQuantitySample[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeHeartbeat {\n timeSinceSeriesStart: number;\n precededByGap: boolean;\n}\n\nexport interface NativeHeartbeatSeriesSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n count: number;\n beats?: NativeHeartbeat[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ClinicalType,\n CorrelationType,\n ElectrocardiogramClassification,\n ElectrocardiogramSymptomsStatus,\n ObjectType,\n WorkoutActivityType,\n} from './identifiers';\n\nexport type DateInput = Date | string;\n\nexport interface AuthorizationOptions {\n toRead?: readonly ObjectType[];\n toShare?: readonly ObjectType[];\n}\n\nexport interface SampleQueryOptions {\n type: ObjectType;\n from?: DateInput;\n to?: DateInput;\n limit?: number;\n ascending?: boolean;\n}\n\nexport interface QuantityQueryOptions extends SampleQueryOptions {\n unit: string;\n}\n\nexport interface WorkoutQueryOptions {\n from?: DateInput;\n to?: DateInput;\n limit?: number;\n ascending?: boolean;\n activityType?: WorkoutActivityType;\n}\n\nexport interface StatisticsQueryOptions {\n type: ObjectType;\n unit: string;\n from?: DateInput;\n to?: DateInput;\n /** Bitmask of `StatisticsOption` values. Combine with bitwise OR. */\n options?: number;\n}\n\nexport interface DateInterval {\n year?: number;\n month?: number;\n day?: number;\n hour?: number;\n minute?: number;\n second?: number;\n}\n\nexport interface StatisticsCollectionQueryOptions extends StatisticsQueryOptions {\n interval?: DateInterval;\n}\n\nexport interface AnchoredQueryOptions extends SampleQueryOptions {\n unit?: string;\n /** Opaque token returned by a previous anchored query. */\n anchor?: string | null;\n}\n\nexport interface QuantitySampleInput {\n type: ObjectType;\n unit: string;\n value: number;\n startDate: DateInput;\n endDate?: DateInput;\n metadata?: Record<string, string>;\n}\n\nexport interface CategorySampleInput {\n type: ObjectType;\n value: number;\n startDate: DateInput;\n endDate?: DateInput;\n metadata?: Record<string, string>;\n}\n\nexport interface WorkoutInput {\n activityType: WorkoutActivityType;\n startDate: DateInput;\n endDate: DateInput;\n energyBurned?: number;\n energyBurnedUnit?: string;\n distance?: number;\n distanceUnit?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface DeleteObjectsOptions {\n uuid?: string;\n type?: ObjectType;\n from?: DateInput;\n to?: DateInput;\n}\n\nexport interface DateRangeQueryOptions {\n from?: DateInput;\n to?: DateInput;\n limit?: number;\n ascending?: boolean;\n}\n\nexport interface ElectrocardiogramQueryOptions extends DateRangeQueryOptions {\n includeVoltage?: boolean;\n}\n\nexport interface ActivitySummaryQueryOptions {\n from?: DateInput;\n to?: DateInput;\n}\n\nexport interface ClinicalRecordQueryOptions extends DateRangeQueryOptions {\n type: ClinicalType | (string & {});\n}\n\nexport interface WorkoutRouteQueryOptions {\n workoutUUID: string;\n}\n\nexport interface CorrelationQueryOptions extends DateRangeQueryOptions {\n type: CorrelationType | (string & {});\n}\n\nexport interface CorrelationObjectInput {\n type: ObjectType;\n unit: string;\n value: number;\n startDate?: DateInput;\n endDate?: DateInput;\n metadata?: Record<string, string>;\n}\n\nexport interface CorrelationInput {\n type: CorrelationType | (string & {});\n startDate: DateInput;\n endDate?: DateInput;\n objects: readonly CorrelationObjectInput[];\n metadata?: Record<string, string>;\n}\n\nexport interface HeartbeatSeriesQueryOptions extends DateRangeQueryOptions {\n /** Default `true`. `false` returns series metadata without beat timestamps. */\n includeBeats?: boolean;\n}\n\nexport interface Correlation {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n objects: QuantitySample[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface Heartbeat {\n timeSinceSeriesStart: number;\n precededByGap: boolean;\n}\n\nexport interface HeartbeatSeriesSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n count: number;\n beats?: Heartbeat[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface QuantitySample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n value: number;\n unit: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface CategorySample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n value: number;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface WorkoutSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n duration: number;\n workoutActivityType: WorkoutActivityType;\n totalEnergyBurned?: number;\n totalEnergyBurnedUnit?: string;\n totalDistance?: number;\n totalDistanceUnit?: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface ElectrocardiogramVoltageMeasurement {\n timeSinceSampleStart: number;\n voltage: number;\n unit: string;\n}\n\nexport interface ElectrocardiogramSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n classification: ElectrocardiogramClassification;\n symptomsStatus: ElectrocardiogramSymptomsStatus;\n averageHeartRate?: number;\n samplingFrequency?: number;\n numberOfVoltageMeasurements: number;\n voltageMeasurements?: ElectrocardiogramVoltageMeasurement[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface AudiogramSensitivityPoint {\n frequency: number;\n leftEarSensitivity?: number;\n rightEarSensitivity?: number;\n}\n\nexport interface AudiogramSample {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n sensitivityPoints: AudiogramSensitivityPoint[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface ActivitySummary {\n date: string;\n activeEnergyBurned: number;\n appleExerciseTime: number;\n appleStandHours: number;\n activeEnergyBurnedGoal: number;\n appleExerciseTimeGoal: number;\n appleStandHoursGoal: number;\n appleMoveTime?: number;\n appleMoveTimeGoal?: number;\n}\n\nexport interface ClinicalRecord {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n displayName: string;\n fhirResourceType?: string;\n fhirJson?: string;\n sourceName?: string;\n sourceId?: string;\n}\n\nexport interface WorkoutRouteLocation {\n latitude: number;\n longitude: number;\n altitude?: number;\n timestamp: Date;\n speed?: number;\n course?: number;\n}\n\nexport interface WorkoutRoute {\n uuid: string;\n type: string;\n startDate: Date;\n endDate: Date;\n locations: WorkoutRouteLocation[];\n}\n\nexport interface DeletedSample {\n uuid: string;\n type?: string;\n}\n\nexport interface Statistics {\n startDate: Date;\n endDate: Date;\n unit: string;\n sum?: number;\n min?: number;\n max?: number;\n average?: number;\n mostRecent?: number;\n}\n\nexport interface AnchoredQueryResult {\n added: QuantitySample[];\n deleted: DeletedSample[];\n anchor: string | null;\n}\n\nexport interface HealthUpdateEvent {\n type: string;\n}\n\n/**\n * Return a promise to keep the app alive (and the HealthKit completion handler\n * pending) until your async work finishes. Resolves are awaited across all\n * listeners; native times out after ~25s regardless.\n */\nexport type HealthUpdateListener = (event: HealthUpdateEvent) => void | Promise<void>;\n\nexport interface NativeHealthUpdateEvent extends HealthUpdateEvent {\n /** Present on iOS. Passed back via `completeUpdate` once listeners finish. */\n token?: string;\n}\n\nexport type ExpoHealthKitModuleEvents = {\n onUpdate: (event: NativeHealthUpdateEvent) => void;\n};\n\nexport interface NativeAuthorizationOptions {\n toRead: string[];\n toShare: string[];\n}\n\nexport interface NativeQuantityQueryOptions {\n type: string;\n unit: string;\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n}\n\nexport interface NativeCategoryQueryOptions {\n type: string;\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n}\n\nexport interface NativeWorkoutQueryOptions {\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n activityType?: number;\n}\n\nexport interface NativeStatisticsQueryOptions {\n type: string;\n unit: string;\n from?: string;\n to?: string;\n options: number;\n}\n\nexport interface NativeStatisticsCollectionQueryOptions extends NativeStatisticsQueryOptions {\n year: number;\n month: number;\n day: number;\n hour: number;\n minute: number;\n second: number;\n}\n\nexport interface NativeAnchoredQueryOptions {\n type: string;\n unit?: string;\n from?: string;\n to?: string;\n limit: number;\n anchor?: string;\n}\n\nexport interface NativeQuantitySampleInput {\n type: string;\n unit: string;\n value: number;\n startDate: string;\n endDate: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeCategorySampleInput {\n type: string;\n value: number;\n startDate: string;\n endDate: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeWorkoutInput {\n activityType: number;\n startDate: string;\n endDate: string;\n energyBurned?: number;\n energyBurnedUnit?: string;\n distance?: number;\n distanceUnit?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeDeleteObjectsOptions {\n uuid?: string;\n type?: string;\n from?: string;\n to?: string;\n}\n\nexport interface NativeQuantitySample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n value: number;\n unit: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeCategorySample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n value: number;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeWorkoutSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n duration: number;\n workoutActivityType: number;\n totalEnergyBurned?: number;\n totalEnergyBurnedUnit?: string;\n totalDistance?: number;\n totalDistanceUnit?: string;\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeDeletedSample {\n uuid: string;\n type?: string;\n}\n\nexport interface NativeStatistics {\n startDate: string;\n endDate: string;\n unit: string;\n sum?: number;\n min?: number;\n max?: number;\n average?: number;\n mostRecent?: number;\n}\n\nexport interface NativeAnchoredQueryResult {\n added: NativeQuantitySample[];\n deleted: NativeDeletedSample[];\n anchor?: string;\n}\n\nexport interface NativeDateRangeQueryOptions {\n from?: string;\n to?: string;\n limit: number;\n ascending: boolean;\n}\n\nexport interface NativeElectrocardiogramQueryOptions extends NativeDateRangeQueryOptions {\n includeVoltage: boolean;\n}\n\nexport interface NativeActivitySummaryQueryOptions {\n from?: string;\n to?: string;\n}\n\nexport interface NativeClinicalRecordQueryOptions extends NativeDateRangeQueryOptions {\n type: string;\n}\n\nexport interface NativeWorkoutRouteQueryOptions {\n workoutUUID: string;\n}\n\nexport interface NativeElectrocardiogramVoltageMeasurement {\n timeSinceSampleStart: number;\n voltage: number;\n unit: string;\n}\n\nexport interface NativeElectrocardiogramSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n classification: number;\n symptomsStatus: number;\n averageHeartRate?: number;\n samplingFrequency?: number;\n numberOfVoltageMeasurements: number;\n voltageMeasurements?: NativeElectrocardiogramVoltageMeasurement[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeAudiogramSensitivityPoint {\n frequency: number;\n leftEarSensitivity?: number;\n rightEarSensitivity?: number;\n}\n\nexport interface NativeAudiogramSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n sensitivityPoints: NativeAudiogramSensitivityPoint[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeActivitySummary {\n date: string;\n activeEnergyBurned: number;\n appleExerciseTime: number;\n appleStandHours: number;\n activeEnergyBurnedGoal: number;\n appleExerciseTimeGoal: number;\n appleStandHoursGoal: number;\n appleMoveTime?: number;\n appleMoveTimeGoal?: number;\n}\n\nexport interface NativeClinicalRecord {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n displayName: string;\n fhirResourceType?: string;\n fhirJson?: string;\n sourceName?: string;\n sourceId?: string;\n}\n\nexport interface NativeWorkoutRouteLocation {\n latitude: number;\n longitude: number;\n altitude?: number;\n timestamp: string;\n speed?: number;\n course?: number;\n}\n\nexport interface NativeWorkoutRoute {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n locations: NativeWorkoutRouteLocation[];\n}\n\nexport interface NativeCorrelationQueryOptions extends NativeDateRangeQueryOptions {\n type: string;\n}\n\nexport interface NativeCorrelationInput {\n type: string;\n startDate: string;\n endDate: string;\n objects: NativeQuantitySampleInput[];\n metadata?: Record<string, string>;\n}\n\nexport interface NativeHeartbeatSeriesQueryOptions extends NativeDateRangeQueryOptions {\n includeBeats: boolean;\n}\n\nexport interface NativeCorrelation {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n objects: NativeQuantitySample[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface NativeHeartbeat {\n timeSinceSeriesStart: number;\n precededByGap: boolean;\n}\n\nexport interface NativeHeartbeatSeriesSample {\n uuid: string;\n type: string;\n startDate: string;\n endDate: string;\n count: number;\n beats?: NativeHeartbeat[];\n sourceName?: string;\n sourceId?: string;\n metadata?: Record<string, string>;\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"platforms": ["apple", "android"],
|
|
3
3
|
"apple": {
|
|
4
|
-
"modules": ["ExpoHealthKitModule"]
|
|
4
|
+
"modules": ["ExpoHealthKitModule"],
|
|
5
|
+
"appDelegateSubscribers": ["HealthKitAppDelegateSubscriber"]
|
|
5
6
|
},
|
|
6
7
|
"android": {
|
|
7
8
|
"modules": ["expo.modules.healthkit.ExpoHealthKitModule"]
|
|
@@ -9,15 +9,13 @@ public class ExpoHealthKitModule: Module {
|
|
|
9
9
|
Events("onUpdate")
|
|
10
10
|
|
|
11
11
|
OnCreate {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"type": type
|
|
15
|
-
])
|
|
16
|
-
}
|
|
12
|
+
// Fallback for apps that don't run the Expo AppDelegate subscriber.
|
|
13
|
+
HealthKitObserverCenter.shared.restore()
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
OnDestroy {
|
|
20
|
-
|
|
17
|
+
// Observer queries intentionally survive module teardown (JS reload).
|
|
18
|
+
HealthKitObserverCenter.shared.setEmitter(nil)
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
Function("isHealthDataAvailable") {
|
|
@@ -141,15 +139,30 @@ public class ExpoHealthKitModule: Module {
|
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
AsyncFunction("observeTypes") { (types: [String]) in
|
|
144
|
-
try
|
|
142
|
+
try HealthKitObserverCenter.shared.observe(types)
|
|
145
143
|
}
|
|
146
144
|
|
|
147
145
|
AsyncFunction("clearObserverQueries") {
|
|
148
|
-
|
|
146
|
+
HealthKitObserverCenter.shared.clear()
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
AsyncFunction("getObservedTypes") {
|
|
150
|
+
HealthKitObserverCenter.shared.observedTypes()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
AsyncFunction("completeUpdate") { (token: String) in
|
|
154
|
+
HealthKitObserverCenter.shared.completeUpdate(token: token)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
OnStartObserving("onUpdate") {
|
|
158
|
+
HealthKitObserverCenter.shared.setEmitter { [weak self] event in
|
|
159
|
+
self?.sendEvent("onUpdate", event)
|
|
160
|
+
}
|
|
149
161
|
}
|
|
150
162
|
|
|
151
163
|
OnStopObserving("onUpdate") {
|
|
152
|
-
|
|
164
|
+
// Keep queries alive; only detach the JS sink so deliveries queue again.
|
|
165
|
+
HealthKitObserverCenter.shared.setEmitter(nil)
|
|
153
166
|
}
|
|
154
167
|
}
|
|
155
168
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
|
|
3
|
+
/// Re-registers persisted HealthKit observer queries as soon as the app process
|
|
4
|
+
/// starts, before the JS runtime boots. Required for background delivery to work
|
|
5
|
+
/// when iOS relaunches a killed app.
|
|
6
|
+
public final class HealthKitAppDelegateSubscriber: ExpoAppDelegateSubscriber {
|
|
7
|
+
public func application(
|
|
8
|
+
_ application: UIApplication,
|
|
9
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
10
|
+
) -> Bool {
|
|
11
|
+
HealthKitObserverCenter.shared.restore()
|
|
12
|
+
return true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import HealthKit
|
|
2
|
+
import OSLog
|
|
3
|
+
import UIKit
|
|
4
|
+
|
|
5
|
+
private let observerLog = Logger(subsystem: "expo-healthkit", category: "observer")
|
|
6
|
+
|
|
7
|
+
/// Process-wide owner of `HKObserverQuery`s.
|
|
8
|
+
///
|
|
9
|
+
/// Lives outside the Expo module instance so observers survive JS reloads and can be
|
|
10
|
+
/// re-registered from `application(_:didFinishLaunchingWithOptions:)` before the
|
|
11
|
+
/// JS runtime exists. Apple requires observer queries to be running at launch for
|
|
12
|
+
/// background delivery to wake a killed app.
|
|
13
|
+
///
|
|
14
|
+
/// Each delivery is handed to JS as `{ type, token }`. The HealthKit completion handler
|
|
15
|
+
/// (plus a `UIBackgroundTask`) is held until JS calls `completeUpdate(token)` or the
|
|
16
|
+
/// timeout fires. Events that arrive before JS subscribes are queued and flushed when
|
|
17
|
+
/// the module starts observing `onUpdate`.
|
|
18
|
+
internal final class HealthKitObserverCenter {
|
|
19
|
+
static let shared = HealthKitObserverCenter()
|
|
20
|
+
|
|
21
|
+
private static let observedTypesKey = "expo.healthkit.observedTypes"
|
|
22
|
+
/// iOS grants roughly 30 seconds of background execution per delivery.
|
|
23
|
+
private static let completionTimeout: TimeInterval = 25
|
|
24
|
+
private static let maxQueuedEvents = 64
|
|
25
|
+
|
|
26
|
+
private struct PendingUpdate {
|
|
27
|
+
let handler: HKObserverQueryCompletionHandler
|
|
28
|
+
let backgroundTask: UIBackgroundTaskIdentifier
|
|
29
|
+
let timeout: DispatchWorkItem
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private let store = HKHealthStore()
|
|
33
|
+
private let queue = DispatchQueue(label: "expo.healthkit.observer-center")
|
|
34
|
+
|
|
35
|
+
private var queries: [String: HKObserverQuery] = [:]
|
|
36
|
+
private var pending: [String: PendingUpdate] = [:]
|
|
37
|
+
private var queuedEvents: [[String: Any]] = []
|
|
38
|
+
private var emitter: (([String: Any]) -> Void)?
|
|
39
|
+
|
|
40
|
+
private init() {}
|
|
41
|
+
|
|
42
|
+
// MARK: - Public API
|
|
43
|
+
|
|
44
|
+
/// Replaces the observed set, persists it, and (re)starts queries.
|
|
45
|
+
func observe(_ identifiers: [String]) throws {
|
|
46
|
+
guard HKHealthStore.isHealthDataAvailable() else {
|
|
47
|
+
throw HealthUnavailableException()
|
|
48
|
+
}
|
|
49
|
+
let sampleTypes = try identifiers.map { ($0, try HealthKitIdentifiers.sampleType(for: $0)) }
|
|
50
|
+
|
|
51
|
+
queue.sync {
|
|
52
|
+
UserDefaults.standard.set(identifiers, forKey: Self.observedTypesKey)
|
|
53
|
+
// Same set already running (e.g. restored at launch): don't tear down and
|
|
54
|
+
// re-execute, which would make HealthKit fire every observer again.
|
|
55
|
+
if Set(identifiers) == Set(queries.keys) {
|
|
56
|
+
observerLog.notice("observe: \(identifiers.count) type(s) already running, skipping restart")
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
stopAllQueriesLocked()
|
|
60
|
+
for (identifier, sampleType) in sampleTypes {
|
|
61
|
+
startQueryLocked(identifier: identifier, sampleType: sampleType)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/// Stops all queries and forgets the persisted set.
|
|
67
|
+
func clear() {
|
|
68
|
+
queue.sync {
|
|
69
|
+
stopAllQueriesLocked()
|
|
70
|
+
UserDefaults.standard.removeObject(forKey: Self.observedTypesKey)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
func observedTypes() -> [String] {
|
|
75
|
+
UserDefaults.standard.stringArray(forKey: Self.observedTypesKey) ?? []
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/// Re-registers persisted observers. Safe to call repeatedly; already-running
|
|
79
|
+
/// queries are left alone. Called from the AppDelegate subscriber at launch and
|
|
80
|
+
/// from the module's `OnCreate` as a fallback.
|
|
81
|
+
func restore() {
|
|
82
|
+
guard HKHealthStore.isHealthDataAvailable() else {
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
let identifiers = observedTypes()
|
|
86
|
+
guard !identifiers.isEmpty else {
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
queue.sync {
|
|
91
|
+
var restored = 0
|
|
92
|
+
for identifier in identifiers where queries[identifier] == nil {
|
|
93
|
+
guard let sampleType = try? HealthKitIdentifiers.sampleType(for: identifier) else {
|
|
94
|
+
continue
|
|
95
|
+
}
|
|
96
|
+
startQueryLocked(identifier: identifier, sampleType: sampleType)
|
|
97
|
+
restored += 1
|
|
98
|
+
}
|
|
99
|
+
observerLog.notice("restore: re-registered \(restored) observer(s), emitter=\(self.emitter != nil)")
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// Called by JS once its listeners have finished processing a delivery.
|
|
104
|
+
/// Unknown or already-completed tokens are ignored.
|
|
105
|
+
func completeUpdate(token: String) {
|
|
106
|
+
queue.sync {
|
|
107
|
+
finishLocked(token: token, reason: "js")
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/// Wires (or unwires) the JS event sink. Setting a non-nil emitter flushes
|
|
112
|
+
/// any deliveries queued while JS was not listening.
|
|
113
|
+
func setEmitter(_ emitter: (([String: Any]) -> Void)?) {
|
|
114
|
+
queue.sync {
|
|
115
|
+
self.emitter = emitter
|
|
116
|
+
guard let emitter else {
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
let events = queuedEvents
|
|
120
|
+
queuedEvents.removeAll()
|
|
121
|
+
observerLog.notice("emitter attached, flushing \(events.count) queued event(s)")
|
|
122
|
+
for event in events {
|
|
123
|
+
emitter(event)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// MARK: - Internals (must run on `queue`)
|
|
129
|
+
|
|
130
|
+
private func startQueryLocked(identifier: String, sampleType: HKSampleType) {
|
|
131
|
+
let query = HKObserverQuery(sampleType: sampleType, predicate: nil) { [weak self] _, completionHandler, error in
|
|
132
|
+
guard let self else {
|
|
133
|
+
completionHandler()
|
|
134
|
+
return
|
|
135
|
+
}
|
|
136
|
+
if error != nil {
|
|
137
|
+
completionHandler()
|
|
138
|
+
return
|
|
139
|
+
}
|
|
140
|
+
self.handleDelivery(identifier: identifier, completionHandler: completionHandler)
|
|
141
|
+
}
|
|
142
|
+
queries[identifier] = query
|
|
143
|
+
store.execute(query)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private func stopAllQueriesLocked() {
|
|
147
|
+
for query in queries.values {
|
|
148
|
+
store.stop(query)
|
|
149
|
+
}
|
|
150
|
+
queries.removeAll()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private func handleDelivery(identifier: String, completionHandler: @escaping HKObserverQueryCompletionHandler) {
|
|
154
|
+
let token = UUID().uuidString
|
|
155
|
+
|
|
156
|
+
let backgroundTask = UIApplication.shared.beginBackgroundTask(withName: "expo-healthkit.\(identifier)") { [weak self] in
|
|
157
|
+
self?.queue.async {
|
|
158
|
+
self?.finishLocked(token: token, reason: "background-task-expired")
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
let timeout = DispatchWorkItem { [weak self] in
|
|
163
|
+
self?.finishLocked(token: token, reason: "timeout")
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
queue.async {
|
|
167
|
+
self.pending[token] = PendingUpdate(
|
|
168
|
+
handler: completionHandler,
|
|
169
|
+
backgroundTask: backgroundTask,
|
|
170
|
+
timeout: timeout
|
|
171
|
+
)
|
|
172
|
+
self.queue.asyncAfter(deadline: .now() + Self.completionTimeout, execute: timeout)
|
|
173
|
+
|
|
174
|
+
let event: [String: Any] = ["type": identifier, "token": token]
|
|
175
|
+
let appState = UIApplication.shared.applicationState.rawValue
|
|
176
|
+
observerLog.notice("delivery \(token, privacy: .public) for \(identifier, privacy: .public) appState=\(appState) emitter=\(self.emitter != nil)")
|
|
177
|
+
if let emitter = self.emitter {
|
|
178
|
+
emitter(event)
|
|
179
|
+
} else {
|
|
180
|
+
if self.queuedEvents.count >= Self.maxQueuedEvents {
|
|
181
|
+
self.queuedEvents.removeFirst()
|
|
182
|
+
}
|
|
183
|
+
self.queuedEvents.append(event)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private func finishLocked(token: String, reason: String) {
|
|
189
|
+
guard let update = pending.removeValue(forKey: token) else {
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
observerLog.notice("complete \(token, privacy: .public) reason=\(reason, privacy: .public)")
|
|
193
|
+
update.timeout.cancel()
|
|
194
|
+
update.handler()
|
|
195
|
+
if update.backgroundTask != .invalid {
|
|
196
|
+
UIApplication.shared.endBackgroundTask(update.backgroundTask)
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -2,9 +2,6 @@ import HealthKit
|
|
|
2
2
|
|
|
3
3
|
internal final class HealthKitService {
|
|
4
4
|
let store = HKHealthStore()
|
|
5
|
-
var onUpdate: ((String) -> Void)?
|
|
6
|
-
|
|
7
|
-
private var observerQueries: [String: HKObserverQuery] = [:]
|
|
8
5
|
|
|
9
6
|
func executeQuery(_ query: HKQuery) throws {
|
|
10
7
|
try catchingHealthKit {
|
|
@@ -432,31 +429,6 @@ internal final class HealthKitService {
|
|
|
432
429
|
}
|
|
433
430
|
}
|
|
434
431
|
|
|
435
|
-
func startObserving(_ identifiers: [String]) throws {
|
|
436
|
-
try ensureAvailable()
|
|
437
|
-
stopObserving()
|
|
438
|
-
|
|
439
|
-
for identifier in identifiers {
|
|
440
|
-
let sampleType = try HealthKitIdentifiers.sampleType(for: identifier)
|
|
441
|
-
let query = HKObserverQuery(sampleType: sampleType, predicate: nil) { [weak self] _, completionHandler, error in
|
|
442
|
-
defer { completionHandler() }
|
|
443
|
-
guard error == nil else {
|
|
444
|
-
return
|
|
445
|
-
}
|
|
446
|
-
self?.onUpdate?(identifier)
|
|
447
|
-
}
|
|
448
|
-
observerQueries[identifier] = query
|
|
449
|
-
try executeQuery(query)
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
func stopObserving() {
|
|
454
|
-
for query in observerQueries.values {
|
|
455
|
-
store.stop(query)
|
|
456
|
-
}
|
|
457
|
-
observerQueries.removeAll()
|
|
458
|
-
}
|
|
459
|
-
|
|
460
432
|
func ensureAvailable() throws {
|
|
461
433
|
if !isAvailable() {
|
|
462
434
|
throw HealthUnavailableException()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appeeky/expo-healthkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Apple HealthKit and Android Health Connect for Expo. One identifier-based JavaScript API on iOS and Android.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NativeModule, requireNativeModule } from 'expo';
|
|
2
2
|
|
|
3
3
|
import { HealthKitError } from './errors';
|
|
4
|
-
|
|
5
4
|
import type {
|
|
6
5
|
ExpoHealthKitModuleEvents,
|
|
7
6
|
NativeActivitySummary,
|
|
@@ -78,6 +77,8 @@ declare class ExpoHealthKitModule extends NativeModule<ExpoHealthKitModuleEvents
|
|
|
78
77
|
disableAllBackgroundDelivery(): Promise<boolean>;
|
|
79
78
|
observeTypes(types: string[]): Promise<void>;
|
|
80
79
|
clearObserverQueries(): Promise<void>;
|
|
80
|
+
getObservedTypes(): Promise<string[]>;
|
|
81
|
+
completeUpdate(token: string): Promise<void>;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
const nativeModule = requireNativeModule<ExpoHealthKitModule>('ExpoHealthKit');
|
|
@@ -135,6 +135,12 @@ class ExpoHealthKitModule extends NativeModule<ExpoHealthKitModuleEvents> {
|
|
|
135
135
|
async clearObserverQueries(): Promise<void> {
|
|
136
136
|
return unavailable();
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
async getObservedTypes(): Promise<string[]> {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async completeUpdate(): Promise<void> {}
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
export default registerWebModule(ExpoHealthKitModule, 'ExpoHealthKitModule');
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import ExpoHealthKitModule from './ExpoHealthKitModule';
|
|
@@ -47,8 +47,11 @@ import type {
|
|
|
47
47
|
ActivitySummaryQueryOptions,
|
|
48
48
|
AudiogramSample,
|
|
49
49
|
DateRangeQueryOptions,
|
|
50
|
+
HealthUpdateEvent,
|
|
51
|
+
HealthUpdateListener,
|
|
50
52
|
HeartbeatSeriesQueryOptions,
|
|
51
53
|
HeartbeatSeriesSample,
|
|
54
|
+
NativeHealthUpdateEvent,
|
|
52
55
|
QuantityQueryOptions,
|
|
53
56
|
QuantitySample,
|
|
54
57
|
SampleQueryOptions,
|
|
@@ -492,12 +495,75 @@ export async function clearObservers(): Promise<void> {
|
|
|
492
495
|
await ExpoHealthKitModule.clearObserverQueries();
|
|
493
496
|
}
|
|
494
497
|
|
|
495
|
-
|
|
496
|
-
|
|
498
|
+
/**
|
|
499
|
+
* Types currently registered with `observe`. Persisted natively on iOS, so it
|
|
500
|
+
* reflects observers re-registered at cold launch too.
|
|
501
|
+
*/
|
|
502
|
+
export async function getObservedTypes(): Promise<string[]> {
|
|
503
|
+
if (!isAvailable()) return [];
|
|
504
|
+
return ExpoHealthKitModule.getObservedTypes();
|
|
497
505
|
}
|
|
498
506
|
|
|
499
|
-
|
|
500
|
-
|
|
507
|
+
const updateListeners = new Set<HealthUpdateListener>();
|
|
508
|
+
let nativeUpdateSubscription: { remove(): void } | null = null;
|
|
509
|
+
|
|
510
|
+
function runListener(listener: HealthUpdateListener, event: HealthUpdateEvent): Promise<void> {
|
|
511
|
+
try {
|
|
512
|
+
return Promise.resolve(listener(event));
|
|
513
|
+
} catch (error) {
|
|
514
|
+
return Promise.reject(error);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
function handleNativeUpdate(nativeEvent: NativeHealthUpdateEvent): void {
|
|
519
|
+
const { token, type } = nativeEvent;
|
|
520
|
+
const event: HealthUpdateEvent = { type };
|
|
521
|
+
const results = [...updateListeners].map((listener) => runListener(listener, event));
|
|
522
|
+
|
|
523
|
+
Promise.allSettled(results).then((settled) => {
|
|
524
|
+
if (__DEV__) {
|
|
525
|
+
for (const result of settled) {
|
|
526
|
+
if (result.status === 'rejected') {
|
|
527
|
+
console.warn('[expo-healthkit] update listener threw', result.reason);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (token) {
|
|
532
|
+
ExpoHealthKitModule.completeUpdate(token).catch(() => {});
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Subscribe to observer / background-delivery updates. Return a promise from the
|
|
539
|
+
* listener to hold the iOS completion handler until your async work is done.
|
|
540
|
+
*/
|
|
541
|
+
export function addUpdateListener(listener: HealthUpdateListener): { remove(): void } {
|
|
542
|
+
updateListeners.add(listener);
|
|
543
|
+
if (!nativeUpdateSubscription) {
|
|
544
|
+
nativeUpdateSubscription = ExpoHealthKitModule.addListener('onUpdate', handleNativeUpdate);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
return {
|
|
548
|
+
remove() {
|
|
549
|
+
updateListeners.delete(listener);
|
|
550
|
+
if (updateListeners.size === 0 && nativeUpdateSubscription) {
|
|
551
|
+
nativeUpdateSubscription.remove();
|
|
552
|
+
nativeUpdateSubscription = null;
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export function useHealthKitUpdates(): HealthUpdateEvent | null {
|
|
559
|
+
const [event, setEvent] = useState<HealthUpdateEvent | null>(null);
|
|
560
|
+
|
|
561
|
+
useEffect(() => {
|
|
562
|
+
const subscription = addUpdateListener((next) => setEvent(next));
|
|
563
|
+
return () => subscription.remove();
|
|
564
|
+
}, []);
|
|
565
|
+
|
|
566
|
+
return event;
|
|
501
567
|
}
|
|
502
568
|
|
|
503
569
|
const HealthKit = {
|
|
@@ -533,6 +599,7 @@ const HealthKit = {
|
|
|
533
599
|
disableAllBackgroundDelivery,
|
|
534
600
|
observe,
|
|
535
601
|
clearObservers,
|
|
602
|
+
getObservedTypes,
|
|
536
603
|
addUpdateListener,
|
|
537
604
|
useHealthKitUpdates,
|
|
538
605
|
QuantityType,
|
package/src/types.ts
CHANGED
|
@@ -320,8 +320,20 @@ export interface HealthUpdateEvent {
|
|
|
320
320
|
type: string;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
+
/**
|
|
324
|
+
* Return a promise to keep the app alive (and the HealthKit completion handler
|
|
325
|
+
* pending) until your async work finishes. Resolves are awaited across all
|
|
326
|
+
* listeners; native times out after ~25s regardless.
|
|
327
|
+
*/
|
|
328
|
+
export type HealthUpdateListener = (event: HealthUpdateEvent) => void | Promise<void>;
|
|
329
|
+
|
|
330
|
+
export interface NativeHealthUpdateEvent extends HealthUpdateEvent {
|
|
331
|
+
/** Present on iOS. Passed back via `completeUpdate` once listeners finish. */
|
|
332
|
+
token?: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
323
335
|
export type ExpoHealthKitModuleEvents = {
|
|
324
|
-
onUpdate: (event:
|
|
336
|
+
onUpdate: (event: NativeHealthUpdateEvent) => void;
|
|
325
337
|
};
|
|
326
338
|
|
|
327
339
|
export interface NativeAuthorizationOptions {
|