Interface SdkBuilder
A builder class you can use to instantiate your instance of the SDK.
public interface SdkBuilder
All Known Implementing Classes: ← : JustTrackSdkBuilder
Methods
build
@NonNull
JustTrackSdk build()
Build a new instance of the SDK. You should not use the builder after calling this method.
Returns
A fresh instance of the SDK.
Throws
Name | Description |
---|---|
IllegalArgumentException | Thrown if the SDK could not be build because a parameter |
setAttributionRetryDelaySeconds
@NonNull
SdkBuilder setAttributionRetryDelaySeconds(long attributionRetryDelaySeconds)
Specify the number of seconds the SDK waits between tries to get an attribution after a network failure.
Parameters
Name | Description |
---|---|
attributionRetryDelaySeconds | The number of seconds until another try is made to fetch an attribution. |
Returns
The builder so you can chain methods if you want.
setAutomaticInAppPurchaseTracking
@NonNull
SdkBuilder setAutomaticInAppPurchaseTracking(boolean enabled)
The justtrack SDK can automatically track in-app product and subscription purchases and forward them to the justtrack backend. It is enabled by default, but this method allows you to configure the automation for your needs.
Parameters
Name | Description |
---|---|
enabled | Set this to true to automatically forward in-app product and subscription purchases. |
Returns
The builder so you can chain methods if you want.
setEnableBroadcastReceiver
@NonNull
SdkBuilder setEnableBroadcastReceiver(boolean enabled)
Configure whether the SDK registers a BroadcastReceiver
to integrate
with other justtrack libraries. This is enabled by default, but you can disable it if you
know that registering such a receiver is not allowed (e.g., because your app is currently in the
background).
If a BroadcastReceiver
can not be registered by the SDK, an error will
be logged and the integration with other justtrack libraries is slightly degraded.
Parameters
Name | Description |
---|---|
enabled | True if the SDK should try to register a BroadcastReceiver . |
Returns
The builder so you can chain methods if you want.
setEnableFirebaseIntegration
@NonNull
SdkBuilder setEnableFirebaseIntegration(boolean enableFirebaseIntegration)
Specify whether we should automatically integrate with the Firebase SDK and send the Firebase app instance id of the user to the justtrack backend.
The integration is enabled by default if the Firebase SDK was detected in your app. You can however use this method to override the default behavior (although forcing the integration has a huge chance of not working, if we can't find the Firebase SDK, we will most likely not be able to talk to it, either).
You can disable the Firebase integration if you are already sending the Firebase app instance
id to the justtrack SDK by hand (see setFirebaseAppInstanceId(String)
or
JustTrackSdk.setFirebaseAppInstanceId(String)
).
Parameters
Name | Description |
---|---|
enableFirebaseIntegration | Whether we should send the Firebase app instance id |
Returns
The builder so you can chain methods if you want.
setEnableIronSourceIntegration
@NonNull
SdkBuilder setEnableIronSourceIntegration(boolean enabled, @NonNull UserIdSource userIdSource)
Configure whether the SDK should integrate with IronSource and configure which user id it should
forward to IronSource after you call build()
. The SDK will also send an AppEvent
for each ad to the backend.
This method overrides the setting from setEnableIronSourceIntegration(boolean, String)
.
By default the integration is disabled.
Parameters
Name | Description |
---|---|
enabled | True if the SDK should integrate with IronSource. |
userIdSource | Configures whether we forward the justtrack user id or no user id at all. |
Returns
The builder so you can chain methods if you want.
setEnableIronSourceIntegration
@NonNull
SdkBuilder setEnableIronSourceIntegration(boolean enabled, @NonNull String customUserId)
Configure whether the SDK should integrate with IronSource and provide the userId you specified
after you call build()
. The SDK will also send an AppEvent
for each ad
impression to the backend.
This method overrides the setting from setEnableIronSourceIntegration(boolean, UserIdSource)
.
By default the integration is disabled.
Parameters
Name | Description |
---|---|
enabled | True if the SDK should integrate with IronSource. |
customUserId | The user id to forward to IronSource. |
Returns
The builder so you can chain methods if you want.
setFirebaseAppInstanceId
@NonNull
SdkBuilder setFirebaseAppInstanceId(@NonNull String firebaseAppInstanceId) throws InvalidFieldException
Forward the Firebase app instance id (how to obtain one) to the justtrack backend upon SDK init.
You don't need to call this method if you rely on the automatic integration (see setEnableFirebaseIntegration(boolean)
)
or later publish the Firebase app instance id by hand (JustTrackSdk.setFirebaseAppInstanceId(String)
).
The Firebase app instance id must be between 8 and 256 characters and consist only of printable ASCII characters (U+0020 to U+007E).
Parameters
Name | Description |
---|---|
firebaseAppInstanceId | The id to forward. |
Returns
The builder so you can chain methods if you want.