Skip to main content
All Spike SDK async method calls should be wrapped into try catch block.

Step 1: Create a Spike Connection

To set up the Spike SDK create SpikeConnectionV3 instance with your Spike application id, application user id and signature unique to each of your application 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 to iOS permissions rules.

Step 3: Get Data

Info: The maximum permitted date range is 90 days There are four types of data you can retrieve from Spike:
  • Statistics are calculated values derived from records.
  • Activities are data about a user’s activities or workouts.
  • Sleep is data about a 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:
where:

Records

where: