| java.lang.Object | |
| ↳ | com.applovin.sdk.AppLovinSdk |
This is a base class for AppLovin Ad SDK.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| interface | AppLovinSdk.SdkInitializationListener | Listener interface to be used with initializeSdk(SdkInitializationListener)
|
|||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final String | VERSION | Current SDK version. | |||||||||
| public static final int | VERSION_CODE | ||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| AppLovinAdService |
getAdService()
Get an instance of the AppLovin Ad service.
| ||||||||||
| AppLovinSdkConfiguration |
getConfiguration()
Get the SDK configuration object provided upon initialization.
| ||||||||||
| AppLovinEventService |
getEventService()
Get an instance of the AppLovin event service.
| ||||||||||
| static AppLovinSdk |
getInstance(Context context)
Get instance of AppLovin SDK that is configured in
AndroidManifest.xml. | ||||||||||
| static AppLovinSdk |
getInstance(String sdkKey, AppLovinSdkSettings userSettings, Context context)
Get an instance of AppLovin SDK.
| ||||||||||
| static AppLovinSdk |
getInstance(AppLovinSdkSettings settings, Context context)
Get instance of AppLovin SDK that is configured in
AndroidManifest.xml. | ||||||||||
| String |
getMediationProvider()
Get the mediation provider that was last set using
setMediationProvider(String), or null if none was set. | ||||||||||
| AppLovinNativeAdService |
getNativeAdService()
Get an instance of the AppLovin native ad service.
| ||||||||||
| AppLovinPostbackService |
getPostbackService()
Get an instance of the AppLovin postback service.
| ||||||||||
| AppLovinSdkSettings |
getSettings()
Get SDK settings provided on initialization
| ||||||||||
| String |
getUserIdentifier()
An identifier for the current user.
| ||||||||||
| AppLovinUserService |
getUserService()
Get an instance of the AppLovin user service object for performing user-related tasks.
| ||||||||||
| AppLovinVariableService |
getVariableService()
Get an instance of the AppLovin variable service.
| ||||||||||
| boolean |
hasCriticalErrors()
Check if SDK has a critical error prior to initialization.
| ||||||||||
| void |
initializeSdk(AppLovinSdk.SdkInitializationListener listener)
Initialize the SDK with a given listener.
| ||||||||||
| static void |
initializeSdk(Context context, AppLovinSdk.SdkInitializationListener listener)
Initialize the default version of the SDK.
| ||||||||||
| static void |
initializeSdk(Context context)
Initialize the default version of the SDK.
| ||||||||||
| void |
initializeSdk()
Initialize the SDK
| ||||||||||
| boolean |
isEnabled()
Check if SDK is enabled.
| ||||||||||
| void |
setMediationProvider(String mediationProvider)
Set mediation provider using one of the provided strings above specified by
AppLovinMediationProvider, or your own if not defined. | ||||||||||
| void |
setPluginVersion(String version)
Set Plugin version.
| ||||||||||
| void |
setUserIdentifier(String userIdentifier)
Set an identifier for the current user.
| ||||||||||
| void |
showMediationDebugger()
Present the mediation debugger UI.
| ||||||||||
| String | toString() | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Current SDK version.
Get an instance of the AppLovin Ad service. This service is used to fetch ads from AppLovin servers.
Get the SDK configuration object provided upon initialization.
Get an instance of the AppLovin event service. This service is used to track post-install user events.
Get instance of AppLovin SDK that is configured in AndroidManifest.xml. Please make sure that AndroidManifest.xml includes following line:
<application>
. . .
<meta-data android:value="YOUR_SDK_KEY_HERE" android:name="APPLOVIN_SDK_KEY" />
</application>
| context | Android application context. Must not be null. |
|---|
Get an instance of AppLovin SDK.
| sdkKey | Client SDK's key. |
|---|---|
| userSettings | User-provided settings. May be null. |
| context | Android context. Must not be null. Note that a reference to context.getApplicationContext() will be persisted by the API. |
Get instance of AppLovin SDK that is configured in AndroidManifest.xml. Please make sure that AndroidManifest.xml includes following line:
<application>
. . .
<meta-data android:value="YOUR_SDK_KEY_HERE" android:name="applovin.sdk.key" />
</application>
| settings | Settings to use with an SDK. Must not be null. |
|---|---|
| context | Android application context. Must not be null. |
Get the mediation provider that was last set using setMediationProvider(String), or null if none was set.
Get an instance of the AppLovin native ad service. This service is used to fetch in-content ads from AppLovin servers.
Get an instance of the AppLovin postback service. This service is used to dispatch HTTP GET postbacks to arbitrary URLs.
Get SDK settings provided on initialization
An identifier for the current user. This identifier will be tied to SDK events and our optional S2S postbacks.
If you're using reward validation, you can optionally set an identifier to be included with currency validation postbacks. For example, a username or email. We'll include this in the postback when we ping your currency endpoint from our server.
Get an instance of the AppLovin user service object for performing user-related tasks.
Get an instance of the AppLovin variable service. This service is used to perform various AB tests that you have set up on your AppLovin dashboard on your users.
Check if SDK has a critical error prior to initialization.
Initialize the SDK with a given listener.
The callback will be invoked on the main thread.
| listener | The callback that will be run when the SDK finishes initializing. May be null. |
|---|
Initialize the default version of the SDK.
Please make sure that AndroidManifest.xml includes following line:
<application>
. . .
<meta-data android:name="applovin.sdk.key" android:value="APPLOVIN_SDK_KEY" />
</application>
| context | Android application context. Must not be null. |
|---|---|
| listener | The callback that will be run when the SDK finishes initializing. May be null. |
Initialize the default version of the SDK.
Please make sure that AndroidManifest.xml includes following line:
<application>
. . .
<meta-data android:name="applovin.sdk.key" android:value="APPLOVIN_SDK_KEY" />
</application>
| context | Android application context. Must not be null. |
|---|
Initialize the SDK
Check if SDK is enabled. SDK is enabled when (1) client successfully registered with the AppLovin server and (2) client is not banned from the server.
Set mediation provider using one of the provided strings above specified by AppLovinMediationProvider, or your own if not defined.
| mediationProvider | The name of the mediation provider. |
|---|
Set Plugin version.
| version | Plugin version to set. |
|---|
Set an identifier for the current user. This identifier will be tied to SDK events and our optional S2S postbacks.
If you're using reward validation, you can optionally set an identifier to be included with currency validation postbacks. For example, a username or email. We'll include this in the postback when we ping your currency endpoint from our server.
| userIdentifier | The user identifier to be set. |
|---|
Present the mediation debugger UI.
This debugger tool provides the status of your integration for each third-party ad network.
Please call this method after the SDK has initialized, e.g. initializeSdk(SdkInitializationListener).