GuidesComponentsDataSyncandroid

AndroidHealthSync

Read Health Connect records and save mapped OVOK observations

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Render this component inside an AndroidHealthConnectAuthorizationProvider to import the requested Health Connect record types. It starts the import when mounted and renders no visible UI.

import { DataSync } from "@ovok/native/data-sync";

<DataSync.AndroidHealthConnectAuthorizationProvider
  readIdentifiers={["Weight", "Steps"]}
>
  <DataSync.AndroidHealthSync
    dataToSync={androidDataToSync}
    chunkSize={250}
    onProgress={setProgress}
    onError={handleSyncError}
  />
</DataSync.AndroidHealthConnectAuthorizationProvider>;

Props

Every prop, with its type and description, is listed in the @ovok/native/data-sync API reference.

Behavior

  • The component uses the active native Ovok client and Patient session from @ovok/core/next/react context. Mount it after sign-in.
  • A first import reads the most recent 30 days by default. Set minDate when the feature needs an earlier initial boundary.
  • Existing observations and Health Connect page tokens guide later reads. The native client's secure storage keeps page tokens across app restarts per patient and project.
  • Progress updates include idle, started, syncing, paused, failed, or completed; pause reasons are offline and wifi-only.
  • Offline connectivity pauses the service. wifiOnly also pauses it on cellular, then the service resumes when the network meets the policy.

For imports after the app process stops, use the headless task API in @ovok/native/background-sync rather than mounting this React component in a headless task. The task requires a restored client, patient ID, and mapping.

Last updated on

On this page