SDK Documentation
HomeBlogSign up
English
English
  • 🏠Homepage
  • 🧪Test Ad Units
  • Privacy
    • ✅Google Data Safety
  • Android SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
    • 🛠️ProGuard
  • iOS SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Revenue reporting
    • 🙍User consent
    • 🔓Privacy
  • Unity SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Flutter SDK
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Native (Google)
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • React Native
    • ⌨️SDK integration
      • App Open
      • Banner
      • Interstitial
      • Rewarded
      • Targeting
      • Revenue reporting
    • 🙎User consent
    • 🔓Privacy
  • Web SDK
    • ⌨️SDK integration
Con tecnología de GitBook
En esta página
  • Setup project
  • Setup Manifest
  • Request consent
  • Initialize SDK
  • Initialization listener
  • Test mode
  1. Android SDK

SDK integration

Setup project

Depending of the language used by the project for the Gradle scripts, you must follow the steps from the corresponding tab:

In first place, it is needed to add the following Maven repositories inside the repositories block of the settings.gradle file:

In the projects which still use an old structure, the repositories block can be found on the build.gradle file located at the app-level.

repositories {
    maven { url 'https://maven.wortise.com/artifactory/public' }
    
    maven { url 'https://android-sdk.is.com/' }
    maven { url 'https://artifact.bytedance.com/repository/pangle' }
    maven { url 'https://cboost.jfrog.io/artifactory/chartboost-ads/' }
}

Once added, you can proceed to integrate the SDK. To do so, you have to add the following line inside the dependencies block of the build.gradle file located at the app-level:

implementation 'com.wortise:android-sdk:1.7.0'

In case of not already have it, it is needed to activate the Java 8 compatibility in the project. This can be achieved by adding these extra lines inside the android block, also in the same build.gradle file:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

In first place, it is needed to add the following Maven repositories inside the repositories block of the settings.gradle.kts file:

dependencyResolutionManagement {
    repositories {
        maven { url = uri("https://maven.wortise.com/artifactory/public") }
    
        maven { url = uri("https://android-sdk.is.com/") }
        maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
        maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
    }
}

Once added, you can proceed to integrate the SDK. To do so, you have to add the following line inside the dependencies block of the build.gradle.kts file located at the app-level:

implementation("com.wortise:android-sdk:1.7.0")

In case of not already have it, it is needed to activate the Java 8 compatibility in the project. This can be achieved by adding these extra lines inside the android block, also in the same build.gradle.kts file:

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

Setup Manifest

It is needed to add the following <meta-data> element in the AndroidManifest.xml file, inside the <application> block, with Google's application ID as value:

<manifest>
    ...
    <application>
        ...
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
    </application>
</manifest>

This value can be found in our dashboard, inside the app details, under the name Google App ID.

Request consent

It is very recommended to request the user consent to be able to show personalised ads. This will allow to display content of more interest and generate higher revenues.

Initialize SDK

Our recommendation is to initialize the SDK in the Application class of the app, but it can also be done in any main Activity.

To do so, it is necessary to integrate the following code in the onCreate method:

WortiseSdk.initialize(this, "your app key")
WortiseSdk.initialize(this, "your app key");

Initialization listener

There are two possible ways to know when the SDK finishes its initialization:

Passing a listener as the last parameter of the method WortiseSdk.initialize

WortiseSdk.initialize(this, "your app key") {
    // This listener will be invoked when the initialization finishes
}
WortiseSdk.initialize(this, "your app key", () -> {
    // This listener will be invoked when the initialization finishes
    return Unit.INSTANCE;
});

Using the method WortiseSdk.wait

WortiseSdk.wait {
    // This listener will be invoked when the initialization finishes
}
WortiseSdk.wait(() -> {
    // This listener will be invoked when the initialization finishes
    return Unit.INSTANCE;
});

Test mode

To verify the integration, the SDK provides a test mode that allows the app to always receive ads.

Beside the option that is available in our dashboard, you can programmatically enable this test mode, from the SDK itself, by using the following code:

AdSettings.testEnabled = true
AdSettings.setTestEnabled(true);
AnteriorGoogle Data SafetySiguienteApp Open

Última actualización hace 3 días

You can consult the following section to implement this request and obtain the user consent:

⌨️
User consent