Integrate the ironSource SDK
When you integrate the ironSource SDK with the justtrack SDK. We'll be able to forward ad impression events to the justtrack backend so you can analyze that data.
There are two ways to enable ironSource integration with the justtrack SDK:
- Configure the SDK builder
- Integrate manually
Only one of these methods is required.
SDK builder
You can integrate with the ironSource SDK using a JustTrackSdkBuilder
:
let builder = /* create the builder somehow */ JustTrackSdkBuilder(apiToken: "prod-...")
let sdk = builder
.set(enableIronSourceIntegration: true, userIdSource: .justtrack)
// or, if you want to provide your own user ID:
.set(enableIronSourceIntegration: true, userIdSource: .customUserId("...your user ID..."))
// other options...
.build()
Each call to .set(enableIronSourceIntegration:userIdSource:)
overrides the previous calls. Therefore, only the last call before .build()
is applied.
If you tell the SDK builder to integrate with the ironSource SDK, you won't get notified about whether the integration failed or was successful. As the integration depends on the attribution, it's done asynchronously in the background. So, it might not be done after the call to .build()
returns.
Manual integration
You can integrate with the ironSource SDK manually. After creating an instance of the justtrack SDK, call sdk.integrateWithIronSource() -> Result<Void, Error>
:
// kick off the integration, will eventually complete as long as attribution succeeds
sdk.integrateWithIronSource(userIdSource: .justtrack)
// or, if you want to provide your own user ID:
sdk.integrateWithIronSource(customUserId: "...your user ID...")