Initialize the SDK
You need to initialize the adjoe SDK before you can use any of its features. To do this, call adjoe.init(String, Options)
as early in your application lifecycle as possible. The initialization will run asynchronously in the background and notify you when it is finished by sending the onInitialisationFinished
or onInitialisationError
event. After one successful initialization all following calls to adjoe.init
will immediately send the onInitialisationFinished
event until your app is removed from the heap.
The SDK initialization should be started as soon as possible after the app comes to foreground to make sure that all adjoe features are available when you want to use them.
Best practices for the SDK initialization:
Initialize early: You should initialize the SDK as soon as possible after your app starts to make sure that all adjoe features are available when you want to use them.
Initialize regularly: For the best user experience, we highly recommend to call this method every time your app comes to the foreground. This should not be noticeable in your app's performance.
Initialization triggers: Good places to call this method are the app start and your main component's constructor.
Example
The parameters to this call are as follows:
String apiKey: Your adjoe SDK hash.
Options options: An object to pass additional options to the adjoe SDK when initializing.
You can set the following parameters in the options object:
AdjoeParams params: A table containing User Acquisition and Playtime placement parameters.
String userId: A custom identifier that you wish to assign to this user. If you don't have an identifier for your user already, omit this parameter and the adjoe SDK will generate one. You can then access it by calling
Adjoe.getUserId()
.
If you want to use S2S payout, you have to set the user id in order to match the payout to your user.
Adjoe Parameters
You can pass additional UA and placement parameters when you initialize the SDK
Last updated