Read your first health data in Blueprint
Build a Blueprint that initializes HealthBridge and reads the last seven days of step samples. Complete this lesson in the editor with mock data before moving to a mobile device.
Before you begin
Section titled “Before you begin”- Install and verify HealthBridge.
- Enable read permission for Steps under Tools > HealthBridge > Permissions.
- Create an Actor Blueprint and place it in an empty level.
Build the graph
Section titled “Build the graph”- In Event BeginPlay, get the game instance’s
HealthBridgeSubsystem. - Store the subsystem in a variable so you can reuse it.
- Call Auto Initialize and create its completion event.
- Branch on the returned success value.
- From the successful branch, call Read Data Type.
- Choose Steps from the
Data Typedropdown. - Set
Days Backto7andMax Recordsto100. - Create the read completion event and branch on
bSuccessin the returnedHealth Data Read Result. - On success, iterate over
Samples. - For each sample, call Get Health Data Sample Number with key
count. - Display the value with Print String for this editor-only exercise.
Use the enum-backed Read Data Type node for built-in types. The raw-string Read Data path is intended for custom or newly introduced registry IDs.
Handle every result
Section titled “Handle every result”- Initialization failure: show a safe message that HealthBridge is unavailable.
- Read failure: use the result’s
Errorfor local development, but do not attach raw native payloads or health records to production logs. - Successful empty read: show a normal empty state. On iOS, this can mean no records or denied read access.
- Successful records: process only the fields your feature needs.
Verify the result
Section titled “Verify the result”Press Play in the editor. A successful graph:
- Completes Auto Initialize with
true. - Reports provider
Mockif you call Get Provider Name. - Completes Read Data Type with
bSuccess=true. - Prints one or more mock step counts.
If the graph fails, compare it with the generated examples under Tools > HealthBridge > Samples > Create Blueprint Examples.
