Skip to main content

Introduction

The Open Wearables iOS SDK (OpenWearablesHealthSDK) is a native Swift SDK for secure background synchronization of health data from Apple HealthKit to the Open Wearables platform. This is the core native implementation that powers health data sync on iOS. The Flutter SDK uses this SDK under the hood as a wrapper.

GitHub Repository

View source code, report issues, and contribute to the iOS SDK.

Features

  • Background Sync - Health data syncs even when your app is in the background via HealthKit observer queries and BGTaskScheduler
  • Streaming Sync - Memory-efficient streaming processing for large datasets
  • Resumable Sessions - Sync sessions survive app restarts and device reboots
  • Dual Authentication - Token-based auth with auto-refresh or API key authentication
  • Secure Storage - Credentials stored in iOS Keychain with kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
  • Automatic Retry - Persistent outbox with retry logic for failed uploads
  • Per-User Isolation - State isolation between different user sessions
  • Network Monitoring - Connectivity-aware sync with automatic resume
  • Wide Data Support - Steps, heart rate, workouts, sleep, and 40+ data types

Requirements

Installation

Add the package to your Package.swift:
Or in Xcode: FileAdd Package Dependencies → paste the repository URL.

iOS Configuration

Add the following to your Info.plist:
Then enable HealthKit capability in Xcode:
  1. Open your .xcodeproj or .xcworkspace in Xcode
  2. Select your target → Signing & Capabilities
  3. Click + Capability → Add HealthKit
  4. Check Background Delivery if you want updates while app is closed

Quick Start

Here’s the minimal code to get health sync working:

AppDelegate Setup

For background URL session support, add to your AppDelegate:

Documentation

Integration Guide

Complete guide to integrating the SDK including authentication flow, backend setup, and best practices.

Troubleshooting

Common issues and their solutions for native iOS.

Supported Health Data Types

The SDK supports 40+ health data types via the HealthDataType enum. Pass these as enum values to requestAuthorization(types:completion:):

Next Steps

Integration Guide

Complete step-by-step integration guide.

API Reference

Full API documentation on GitHub.