public final class AppLovinSdk
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
AppLovinSdk.SdkInitializationListener
Listener interface to be used with
initializeSdk(SdkInitializationListener) |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION
Current SDK version.
|
static int |
VERSION_CODE |
Modifier and Type | Method and Description |
---|---|
static java.util.List<AppLovinSdk> |
a()
All the AppLovin SDK instances currently in memory.
|
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(AppLovinSdkSettings settings,
android.content.Context context)
Get instance of AppLovin SDK that is configured in
AndroidManifest.xml . |
static AppLovinSdk |
getInstance(android.content.Context context)
Get instance of AppLovin SDK that is configured in
AndroidManifest.xml . |
static AppLovinSdk |
getInstance(java.lang.String sdkKey,
AppLovinSdkSettings userSettings,
android.content.Context context)
Get an instance of AppLovin SDK.
|
Logger |
getLogger()
Deprecated.
This method is for internal use only and will be removed in a future SDK version.
|
java.lang.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.
|
java.lang.String |
getSdkKey()
Get client SDK key.
|
AppLovinSdkSettings |
getSettings()
Get SDK settings provided on initialization
|
java.lang.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()
Initialize the SDK
|
void |
initializeSdk(AppLovinSdk.SdkInitializationListener listener)
Initialize the SDK with a given listener.
|
static void |
initializeSdk(android.content.Context context)
Initialize the default version of the SDK.
|
static void |
initializeSdk(android.content.Context context,
AppLovinSdk.SdkInitializationListener listener)
Initialize the default version of the SDK.
|
boolean |
isEnabled()
Check if SDK is enabled.
|
void |
setMediationProvider(java.lang.String mediationProvider)
Set mediation provider using one of the provided strings above specified by
AppLovinMediationProvider , or your own if not defined. |
void |
setPluginVersion(java.lang.String version)
Set Plugin version.
|
void |
setUserIdentifier(java.lang.String userIdentifier)
Set an identifier for the current user.
|
void |
showMediationDebugger()
Present the mediation debugger UI.
|
java.lang.String |
toString() |
public static final java.lang.String VERSION
public static final int VERSION_CODE
public java.lang.String getSdkKey()
public AppLovinSdkSettings getSettings()
public void setPluginVersion(java.lang.String version)
version
- Plugin version to set.public void setMediationProvider(java.lang.String mediationProvider)
AppLovinMediationProvider
, or your own if not defined.mediationProvider
- The name of the mediation provider.public java.lang.String getMediationProvider()
setMediationProvider(String)
, or null if none was set.public AppLovinAdService getAdService()
public AppLovinNativeAdService getNativeAdService()
public AppLovinPostbackService getPostbackService()
public AppLovinEventService getEventService()
public AppLovinUserService getUserService()
public AppLovinVariableService getVariableService()
public void setUserIdentifier(java.lang.String userIdentifier)
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.public java.lang.String getUserIdentifier()
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.
public void showMediationDebugger()
Please call this method after the SDK has initialized, e.g. initializeSdk(SdkInitializationListener)
.
public void initializeSdk()
public void initializeSdk(AppLovinSdk.SdkInitializationListener listener)
The callback will be invoked on the main thread.
listener
- The callback that will be run on the main thread when the SDK finishes initializing. May be null.public static void initializeSdk(android.content.Context context)
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.public static void initializeSdk(android.content.Context context, AppLovinSdk.SdkInitializationListener listener)
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 on the main thread when the SDK finishes initializing. May be null.public AppLovinSdkConfiguration getConfiguration()
public static AppLovinSdk getInstance(android.content.Context context)
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.public static AppLovinSdk getInstance(AppLovinSdkSettings settings, android.content.Context context)
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.public static AppLovinSdk getInstance(java.lang.String sdkKey, AppLovinSdkSettings userSettings, android.content.Context context)
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.public boolean isEnabled()
public boolean hasCriticalErrors()
@Deprecated public Logger getLogger()
public static java.util.List<AppLovinSdk> a()
public java.lang.String toString()
toString
in class java.lang.Object