心率通知 - JSON 导出格式
JSON 导出中心率通知结构的文档
最后更新: 2026年10月31日
心率通知包括 Apple Watch 的高/低心率警报、不规则节律通知,以及这些事件期间收集的心率样本。在 JSON 导出中,心率通知存储在 heartRateNotifications 数组中。
结构
每条通知包含事件时间、可选阈值(用于高/低通知)、来源信息,以及事件开始与结束之间的数量序列心率样本:
{
"heartNotification": "high_heart_rate_notification",
"start": "2024-02-06 14:30:00 -0800",
"end": "2024-02-06 14:35:00 -0800",
"threshold": 100,
"source": {
"name": "Apple Watch",
"identifier": "com.example.recorder"
},
"heartRateData": [
{
"qty": 105,
"units": "count/min",
"start": 1707258600,
"end": 1707258605
}
]
}
字段
必填字段
heartNotification(字符串):通知类型标识符start(日期):心率通知事件开始时间,格式为yyyy-MM-dd HH:mm:ss Zend(日期):心率通知事件结束时间,格式为yyyy-MM-dd HH:mm:ss Zsource(对象):记录通知的设备/来源name(字符串):人类可读的来源名称identifier(字符串):来源捆绑标识符
heartRateData(数组):事件窗口期间的心率数量样本(见下方心率数据)
可选字段
threshold(数字):触发通知的心率阈值。仅包含在高和低心率通知中。
心率数据
heartRateData 数组包含通知事件窗口期间的数量序列心率测量。每个样本包含 qty、units、start 和 end:
{
"qty": 105,
"units": "count/min",
"start": 1707258600,
"end": 1707258605
}
字段:
qty(数字):心率值units(字符串):测量单位(通常为"count/min")start(数字):测量时段开始,为 Unix epoch 秒end(数字):测量时段结束,为 Unix epoch 秒