跳过内容

@capgo/capacitor-health

Capacitor 插件用于与 Apple HealthKit 和 Health Connect 数据进行交互。

Capacitor 插件用于与 Apple HealthKit 和 Health Connect 的数据进行交互。

  • isAvailable - 检查当前平台是否支持本地健康 SDK。
  • requestAuthorization - 请求对提供的数据类型的读写访问。
  • checkAuthorization - 检查对提供的数据类型的授权状态,而不提示用户。
  • readSamples - 在指定时间范围内读取给定数据类型的样本。
MethodDescription
isAvailableReturns whether the current platform supports the native health SDK.
requestAuthorizationRequests read/write access to the provided data types.
checkAuthorizationChecks authorization status for the provided data types without prompting the user.
readSamplesReads samples for the given data type within the specified time frame.
saveSampleWrites a single sample to the native health store.
getPluginVersionGet the native Capacitor plugin version.
openHealthConnectSettingsOpens the Health Connect settings screen (Android only). On iOS, this method does nothing.
showPrivacyPolicyShows the app’s privacy policy for Health Connect (Android only). On iOS, this method does nothing.
queryWorkoutsQueries workout sessions from the native health store. Supported on iOS (HealthKit) and Android (Health Connect).
queryAggregatedQueries aggregated health data from the native health store. Aggregates data into time buckets (hour, day, week, month) with operations like sum, average, min, or max. This is more efficient than fetching individual samples for large date ranges.

此参考资料是同步自 src/definitions.tscapacitor-health.

从 @capgo/capacitor-health 中继续前进

Section titled “从 @capgo/capacitor-health 中继续前进”

如果您正在使用 @capgo/capacitor-health 来规划原生插件工作,连接它与 使用 @capgo/capacitor-health 来规划原生能力的使用 @capgo/capacitor-health, Capgo 插件目录 在 Capgo 插件目录中管理产品工作流程 Capacitor 插件由 Capgo 提供 了解 Capacitor 插件由 Capgo 提供的实现细节 添加或更新插件 了解添加或更新插件的实现细节 Ionic 企业插件替代方案 了解 Ionic 企业插件替代方案的产品工作流程