Set up the SDK
The justtrack SDK provides powerful tracking capabilities for attribution, events, and more.
This guide shows you how to add the justtrack SDK to your iOS app.
Add the SDK dependency
Using CocoaPods
You can use CocoaPods to add the justtrack SDK to your app. Add the following line to your Podfile
:
pod 'JustTrackSDK', '6.0.0'
Afterwards, run pod install
in your project to actually download and install the justtrack SDK for your project.
Using Carthage
You can also use Carthage. Add the following line to your Cartfile
:
binary "https://sdk.justtrack.io/carthage/JustTrackSDK.json" == 5.0.0
Afterwards, run carthage update
inside the project directory to download the justtrack SDK for your project.
Using Swift Package Manager
The SDK is available via Swift Package Manager.
To add the SDK package to your Xcode project, select File > Add Package Dependency and enter its repository URL https://github.com/justtrackio/justtrack-sdk-spm
.
justtrack SDK supports Xcode version 15.0 or higher.
Find your API token
Before integrating the justtrack SDK into your app, you need to obtain an API token. Follow our guide to find your token.
Instantiate the SDK
The main entry point to the SDK is the JustTrackSdk
protocol.
Create an SDK instance using the JustTrackSdkBuilder
:
do {
let sdk = try JustTrackSdkBuilder(apiToken: "... paste your API token here").build()
} catch {
// apiToken has invalid format...
}
That’s it!
Once instantiated, JustTrackSdk
is ready to attribute your users.
See our guide on tracking events next.