prod-57e...64 characters...e542and is scoped to your bundle identifier.
JustTrackSDKwhich allows you to attribute the current user, send notifications to the backend or record user events. To create an instance of the SDK you have to invoke the
JustTrackSDKBuilderclass. Instantiating the SDK could look like this:
onDestroyon the SDK when your app terminates. This will unregister all listeners and tear down the session tracking. You have to create a new instance of the SDK before you can use it again.
attributeUserto retrieve an attribution containing your JustTrack user id as well as information about the source of the user.
attributeUserin your app. To get the information about the user attribution in your app you need to call
observeon the future returned by
attributeUser. This will call the provided callback with the
Resultof the attribution of the user.
Futureresolved to a failure value will not update the future. You have to subscribe to updates of the attribution using
registerAttributionListener(listener:)to receive the attribution.
AttributionResponseinterface implements the access layer to an attribution on Swift side, but basically an attribution can look like this:
ExampleAdNetworkwhich belongs to the
ExampleDirectChannel. The user thus was not recruited by another user of your app, but instead was bought by a paid advertisement. The
adsetIdfields will not always be set if you paid for a user.
publishon the event:
UserEventinstance you are creating an immutable
PublishableUserEventobject which you can pass to
publishEvent()as often as you need. Calling
build()does not modify the
UserEventobject if you need to modify it again.
UserEventinstance is actually a builder for the event we later send to the backend. You can either provide all parameters via the constructor if you want or you can initialize an empty event and later call setters for the different properties. The only thing you need to create a new event is the name of the event, which may also not be empty (and can later no longer be changed). The following constructors are provided:
unitcan only always provided together and default to
.count. The three dimensions default to
""if not specified. You can set the properties after initialization also with these methods:
UIApplication.sharedand handling the events relevant for the SDK. If you did set a delegate there already your delegate will still get called as before. If you set another delegate after initializing the SDK you will overwrite the delegate set by the SDK and session tracking will no longer work.
PROGRESSION_QUEST_STARTevents. The tracking ends once you trigger the
PROGRESSION_LEVEL_FAILevents for levels and
PROGRESSION_QUEST_FAILevents for quests. These events are then automatically modified to also carry the total time the user spend with the game open on his device.