Mobile SDK Installation
Learn about the minimum runtime and build-time requirements of Junction Mobile SDKs, and how to add them into
your project through your package dependency manager.
Junction Health SDK
Learn about the initial setup required by Junction Health SDK, and the API exposed by Junction Health SDK
for managing and inspecting health data permissions and automatic data sync.
Sync Frequency
While the SDK schedules hourly data sync with Apple HealthKit, iOS has full discretion to defer the scheduled time
based on factors like CPU usage, battery usage, connectivity, and Low Power Mode.
In other words, the Junction SDK — or any third-party HealthKit apps — cannot guarantee the sync to happen on a strict
schedule. The hourly schedule is advisory and non-binding from the perspective of iOS. The actual delivery frequency
can therefore fluctuate from hourly, to once a day, or when a certain opportunity arises (e.g., when Sleep Mode ends,
or when the phone starts charging).
Getting Started
To enable this integration, you would need to integrate Junction Core SDK and Junction Health SDK into your Native iOS, React Native or Flutter mobile app.1
Add Junction SDKs as dependencies
2
Integrate with Junction Mobile SDK Authentication
Follow the SDK Authentication guidance to integrate your app with the authentication
mechanism of Junction Core SDK.
3
Configure Health SDK and ask user for read permissions
Follow the Junction Health SDK guidance to
configure your App Delegate,
configure the Health SDK and to
ask for health data read permissions from your user.
Health data sync is activated only on
VitalResources for which you have asked your user for permissions. If you
did not ask for permissions, data sync would not occur.4
Configure Background Delivery
Follow the Apple HealthKit Background Delivery guidance below to
set up your iOS app target as an eligible target for Apple HealthKit Background Delivery.
Setting up Apple HealthKit Background Delivery
Junction Health SDK can subscribe to Apple HealthKit Background Delivery, so that data sync can happen automatically in the background. The subscription persists even when:- Your app user does not open your app regularly;
- Your app user force-quits your app; or
- The iPhone has been restarted for any reason.
Enabling Apple HealthKit will attract additional scrutiny in the App Store Review process. You should be prepared
to explain and demonstrate your usage of these health and fitness data.
1. Set up app entitlements
Enable the “HealthKit > Background Delivery” entitlement:

2. Update your Info.plist
In your “Info > Custom iOS Target Properties” section — also known as theInfo.plist file — these entries should be
configured:
If you request write permissions, you must also specify:
3. Epilogue
You are all set! Note that there is no need to callsyncData() manually at all. Once you have asked the user for permission on
resources, sync would automatically start every app launch, as well as whenever your app is woken up by Apple HealthKit to
respond to newly available data.
As per the documentation:
HealthKit wakes your app whenever a process saves or deletes samples of the specified type. The system wakes your app at most once per time period defined by the specified frequency. Some sample types have a maximum frequency ofThis means that although we have background delivery’s frequency set toHKUpdateFrequency.hourly. The system enforces this frequency transparently. For example, on iOS,stepCountsamples have an hourly maximum frequency.
.hourly, we cannot guarantee hourly syncing on the dot.