Mobile SDKs

Synchronize Apple Health, Health Connect, and Samsung Health data from your mobile app.

5 min read Updated Sep 17, 2026

Sonar supports cloud device providers through the server-to-server API. Mobile SDKs provide a separate path for health data stored on a person’s phone. They do not replace the public API or permit a Sonar API key to be embedded in a client application.

SDKs

SurfacePackageOn-device source
iOS (Swift)SonarSDKApple Health through HealthKit
Android (Kotlin)co.sonarhealth:sonar-sdkHealth Connect and Samsung Health
React Native@sonar/react-native-sdkBindings to the iOS and Android SDKs

How Data Moves

Native health records travel directly from the SDK to Sonar. Your backend reads the normalized results through the API and returns the data your app needs. The arrows below follow the data through these two routes.

Mobile SDK architecture

Data flow
Native records go to Sonar. Product data returns through your backend.On the mobile device, the native health store supplies records to the Sonar SDK inside your app. The SDK uploads directly to Sonar ingestion, bypassing your backend. Sonar normalizes the records and exposes them through the public API. Your backend reads the API using its key and returns product data to the app UI. Arrows show the direction of health data, not API requests or session setup.Mobile deviceSonar cloudYour appHealth storeSonar SDKApp UIIngestionUnified APIYour backendAPI key Native records go to Sonar. Product data returns through your backend.On the mobile device, the health store supplies records to the Sonar SDK inside your app. The SDK uploads directly to Sonar ingestion. Normalized data is available through the public API. Your backend reads the API using its key and returns product data to the app UI. Arrows follow health data; session setup and API requests are not shown.Mobile deviceHealth storeYour appSonar SDKApp UISonar cloudIngestionUnified APIYour backendAPI key
Native records Product data

The SDK synchronizes every supported type the user authorizes, owns its local progress and retry behavior, and reports state back to the mobile app. See SDK Authentication, Supported Native Data, and SDK Synchronization for each part of the exchange.

What Each Part Owns

PartResponsibility
Mobile appConfigure the SDK, start authentication, connect providers, and present state and recovery guidance
Customer backendResolve the signed-in customer to a Sonar user, create client tokens, receive webhooks, read API data, and manage source priority
Sonar SDKRequest native permissions, read health records, store incremental progress, upload, retry, and refresh its session
SonarValidate application and user scope, preserve source attribution, apply source priority, normalize records, manage provider connections, and expose the results through the API

Stable Boundaries

  • Long-lived Sonar API keys stay on your backend.
  • Each installed SDK maintains its own session and credentials.
  • The operating system remains the authority for health-data permission state.
  • Apps must handle partial permission grants and permission changes after onboarding.
  • Native data must ultimately use the same Sonar user identity as server-side API reads.

Platform References

  • Mobile SDK Quickstart Complete backend, mobile, synchronization, webhook, and API flow
  • iOS (Swift) HealthKit capabilities, permissions, and background delivery
  • SDK Authentication User-scoped client tokens, refresh, recovery, and revocation
  • SDK Interface Configuration, provider methods, state observation, immediate sync, and safe resynchronization
  • Supported Native Data Apple Health, Health Connect, and Samsung Health records mapped to API resources
  • SDK Synchronization Recent data, historical backfill, batching, retries, and data availability
  • Provider Lifecycle Connect, permission loss, disconnect, reconnection, and deletion
  • Android (Kotlin) Two provider connections, permissions, distribution, and synchronization
  • React Native Cross-platform bindings and native configuration boundaries
  • Cloud Device Providers The server-to-server integration path for cloud providers