WebViewGold 文档 · iOS
🇨🇳 中文
获取 WebViewGold

HealthKit 插件

将您的网页应用连接到 Apple HealthKit,并在 iOS 上经用户授权读取健康数据。

通过在 Config.swift 中的 static let HealthKitEnabled 设置您的插件令牌,并添加 HealthKit 功能,以激活 HealthKit 相关功能。
如需详细信息,请联系 [email protected]

API 用法(激活后):

通过调用 readhealthkit:// 加上 HealthKit 标识符读取 HealthKit 数值。结果会以该标识符命名的 JavaScript 变量注入到您的 Web 应用中(值和单位为字符串):

<a href="readhealthkit://HKQuantityTypeIdentifierStepCount" onclick="setTimeout(function(){ alert(HKQuantityTypeIdentifierStepCount); }, 500)">读取步数</a>

使用 writehealthkit://标识符//数值 语法写入 HealthKit 数值:

<a href="writehealthkit://HKQuantityTypeIdentifierStepCount//100">保存 100 步</a>

注意:需要 HealthKit 功能以及 Info.plist 中的 Privacy - Health Share Usage Description / Privacy - Health Update Usage Description 条目。

太忙了?我们替您搭建应用。

我们的团队为您配置、构建并提交 WebViewGold 应用——全程代劳、交付迅速、德国制造。

让我们搭建应用 →

在浏览器中构建

无需 Mac、无需 IDE:WebViewGold Cloud Builder 在线为您配置、构建并上传应用。

了解 Cloud Builder →