SpikeSDK iOS (v3)
Current Swift SDK Version: 4.0.11
Swift Package can be found here
iOS 13.0+
To add HealthKit support to your application's Capabilities.
- Open the iOS/ folder of your project in Xcode
- Select the project name in the left sidebar
- Open Signing & Capabilities section
- In the main view select '+ Capability' and double click HealthKit
More details you can find here.
Add Health Kit permissions descriptions to your Info.plist file.
CocoaPods is a dependency manager for Cocoa projects. To integrate SpikeSDK into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'SpikeSDK'
Use pod install and pod update commands to install/update pods afterward.
To integrate SpikeSDK into your Xcode project using Swift Package Manager, add it in your Package.swift or through the Project's Package Dependencies tab:
Start getting Spike data in 3 steps. All Spike SDK async method calls should be wrapped into try catch block.
To set up the Spike SDK create SpikeConnectionV3 instance with your Spike application id, auth token and user id unique to each of your users:
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.
Info: The maximum permitted date range is 90 days There are two types of data you can retrieve from Spike:
- Records consist of the raw data points collected from user devices or applications.
- Statistics, on the other hand, are calculated values derived from records.
Get daily statistics for steps and total distance from Apple Health:
where:
where: