Unity API reference
Namespaces
Section titled “Namespaces”HealthBridgeHealthBridge.DataHealthBridge.Helpers
Primary types
Section titled “Primary types”| Type | Purpose |
|---|---|
HealthBridgeService |
Static provider lifecycle and data operations |
HealthBridgeInitializer |
Platform-aware MonoBehaviour; required in Android players |
IHealthProvider |
Common provider contract |
IWorkoutRouteProvider |
Optional route extension |
IHealthDeleteProvider |
Optional deletion extension |
HealthBridgeSettings |
Permissions, platform text, and editor configuration |
HealthDataTypeRegistry |
Unified static type, schema, and permission metadata |
HealthDataTypeCapability |
Runtime state and reason for one registry type |
HealthBridgeEvents |
Main-thread lifecycle and operation events |
WorkoutImporter |
Workout import and progress workflow |
Service operations
Section titled “Service operations”PrewarmAsyncAutoInitializeAsyncReadDataAsyncWriteDataAsyncWriteWorkoutAsyncDeleteDataAsyncandDeleteWorkoutAsyncGetWorkoutRouteAsyncPublishHeartRateSampleIsReadyandProvider
AutoInitializeAsync supports the editor and iOS; Android players require
HealthBridgeInitializer.
Queries and results
Section titled “Queries and results”Always check Success before consuming results:
HealthDataQueryandHealthDataReadResultHealthDataWriteQueryandHealthDataWriteResultHealthDataDeleteQueryandHealthDataDeleteResultWorkoutRouteReadResultPermissionResult
Read results can succeed with zero samples. Route results can require additional user consent.
Events
Section titled “Events”HealthBridgeEvents exposes provider, permission, workout import, heart-rate,
read, write, and delete lifecycle events. Events are delivered on the Unity main
thread.
Subscribe in OnEnable and unsubscribe in OnDisable.
Type capabilities and schemas
Section titled “Type capabilities and schemas”Use HealthBridgeService.GetDataTypeCapabilities() to enumerate every registry
row for the active platform. Use GetDataTypeCapability(id) before one read or
write. The returned HealthDataTypeCapability includes CanRead, CanWrite,
Availability, and a user-presentable Reason when the operation is disabled.
HealthDataTypeInfo.GetFields(platform) provides the fields, units, bounds, and
legal category values for schema-driven forms. This is the supported way to
build a complete type picker without hard-coding a list.
Use HealthBridgeService.Provider.Supports(HealthCapability) before exposing
optional write, delete, route, monitoring, or specialized data UI.
Query defaults
Section titled “Query defaults”HealthDataQuery defaults to seven days and 100 records. Days clamp to 1–90 and
record count to at least one.
Helpers
Section titled “Helpers”WorkoutImporterandImportOptionsExerciseTypeMapperHealthDataTypeRegistry- Typed sample computed date, duration, and unit properties
See data types and units and errors and recovery.
