Step 1 - Create Spike connection
To set up the Spike SDK createSpikeConnectionV3
instance with your Spike application id, application user id and signature unique to each of your apllication users (more on generating signatures here):
Step 2 - Ask user for permissions
Provide permissions to access iOS HealthKit data. Spike SDK method will check required permissions and request them if needed. Permission dialog may not be shown according on iOS permissions rules.Step 3 - Get data
Info: The maximum permitted date range is 90 days There are 4 types of data you can retrieve from Spike:- Statistics are calculated values derived from records.
- Activities are data about user’s activities or workouts.
- Sleep is data about user’s sleep.
- Records consist of the raw data points collected from user devices or applications.
Statistics
Get daily statistics for steps and total distance from Apple Health:Records
Additional information
ThespikeConnection.getUserInfo()
call will only show that Apple HealthKit, Android Health Connect, or Samsung Health Data is enabled after you have successfully retrieved data at least once using functions like getStatistics()
, getRecords()
, or similar data retrieval methods.