Skip to main content

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

If you plan to use Android Health Connect and/or Apple HealthKit data providers you should first get users permission to use their data:
For Android there are more methods that let you get permissions granted by user, check if Health Connect is installed or should be updated, etc. If you are OK with Spike SDK handling these, you can use requestHealthPermissions only. On iOS requestHealthPermissions is the only method that has to be called. Keep in mind that you should do it before trying to read data from Android Health Connect or Apple HealthKit.

Step 3: Get Data

The maximum permitted query date range on Android Health Connect 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

Now you can read hourly statistics data of steps and distance for today:
where:

Records