insertRecords(params: Object)
Requires:
HealthKit≥5.18.0@ray-js/ray≥1.6.17
Platforms:
Android
Description
Batch write health records to Health Connect [Android only]
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
request | string | Yes | JSON array string of RecordData list |
complete | () => void | No | Completion callback (executed on both success and failure) |
| No | Callback on successful API call | ||
fail | (params: Object) => void | No | Failure callback |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None
Error Code
| Error Code | Error Message |
|---|---|
-1001 | Unsupported phone OS version |
-1002 | Data conversion error |
-1003 | No data |
-1004 | Failed to submit to Health Connect |
-1005 | Service error. Please check that Health Connect has auto-start enabled and is not restricted by power management |