SDK Integration

Integrate AdsPlus inyour mobile app.

One tenant ID, one init call. Ad credentials, placement IDs, and frequency caps are pulled at runtime — rotate them without shipping a new build. Pick your platform below.

Prerequisites

Before integrating, register your app in the console and wait for approval. Once approved, the platform generates a tenant_id and provisions ad credentials — that single ID is all the SDK needs.

  1. 1. Create a developer account and sign in.
  2. 2. Submit your app (package name + platform).
  3. 3. Once your app is approved, copy the tenant_id (e.g. tp_abc1234567) from My Apps.
The SDK talks to the AdsPlus backend automatically — it calls POST /sdk/init on cold start and signs /sdk/config & /sdk/event with HMAC-SHA256. No endpoint configuration is needed.

Install

Requirements: Android API 21+, Java 11+, AGP 8.5.2+. Add the SDK repo and the ad mediation repositories to settings.gradle:

settings.gradle.kts
gradle
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        // AdsPlus SDK (local Maven or your hosted repo)
        maven { url = uri("https://your-maven-repo/adsplus") }
        // Ad mediation networks
        maven { url = uri("https://jfrog.anythinktech.com/artifactory/overseas_sdk") }
        maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
        maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
        maven { url = uri("https://artifactory.bidmachine.io/bidmachine") }
        maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
    }
}

Then add the dependency in your app module:

app/build.gradle.kts
gradle
dependencies {
    implementation("com.gameadsdk:ads-sdk-android:1.0.0")
}

Initialize

Initialize once on app launch. Ad objects can only be created after the SDK reports success, because placement IDs arrive from the server during init.

Call from Application.onCreate():

MyApplication.java
java
public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        GADConfig config = new GADConfig.Builder("tp_abc1234567") // from dashboard
                .userId("")                        // empty until the user logs in
                .packageId(getPackageName())
                .build();

        GameAdSDK.getInstance().initialize(this, config, new GADSDKCallback() {
            @Override
            public void onSDKInitialized() {
                // Safe to create ads and call load() from here
            }

            @Override
            public void onSDKInitializeFailed(String error) {
                Log.e("AdsPlus", "Init failed: " + error);
            }
        });
    }
}

Register your Application class in the manifest:

AndroidManifest.xml
xml
<application
    android:name=".MyApplication"
    ... >
</application>

Set user ID

You can initialize with an empty user ID and set it after the user authenticates. The ID is used for revenue attribution and is forwarded to the mediation layer as custom data.

java
// After the user authenticates
GameAdSDK.getInstance().updateUserId("authenticated_user_123");

Rewarded ad

Load ahead of time, check isReady before showing, and reload on close to keep one in the chamber. Grant the reward in the reward callback.

java
String placementId = GameAdSDK.getInstance().getRewardedPlacementId();
RewardedAd rewardedAd = new RewardedAd(placementId);

rewardedAd.setCallback(new RewardedAdCallback() {
    @Override
    public void onAdLoaded(RewardedAd ad) { /* enable "Watch Ad" button */ }

    @Override
    public void onAdLoadFailed(RewardedAd ad, String error) { }

    @Override
    public void onUserRewarded(RewardedAd ad, String rewardType, int rewardAmount) {
        // Grant the reward to the user
    }

    @Override
    public void onAdClosed(RewardedAd ad) { ad.load(); } // preload next
});

rewardedAd.load();

// Show when ready
if (rewardedAd.isReady()) {
    rewardedAd.show(activity);
}

Interstitial ad

Same load / show lifecycle as rewarded, without a reward callback. Reload after close.

java
String placementId = GameAdSDK.getInstance().getInterstitialPlacementId();
InterstitialAd interstitialAd = new InterstitialAd(placementId);

interstitialAd.setCallback(new InterstitialAdCallback() {
    @Override
    public void onAdClosed(InterstitialAd ad) { ad.load(); }
});

interstitialAd.load();

if (interstitialAd.isReady()) {
    interstitialAd.show(activity);
}

MREC ad

A 300×250 banner. Show it once loaded; toggle visibility with hide() / show().

java
String placementId = GameAdSDK.getInstance().getMrecPlacementId();
MRECAd mrecAd = new MRECAd(placementId);

mrecAd.setCallback(new MRECAdCallback() {
    @Override
    public void onAdLoaded(MRECAd ad) {
        ad.show(activity); // auto-positioned bottom-center
    }
});

mrecAd.load();

// Toggle visibility
mrecAd.hide();
mrecAd.show();

Lifecycle & cleanup

Always release ad objects when the hosting screen is torn down to avoid leaks.

java
@Override
protected void onDestroy() {
    super.onDestroy();
    rewardedAd.destroy();
    interstitialAd.destroy();
    mrecAd.destroy();
}

Frequency capping

Caps are driven by the server and checked automatically before every show(): a global disable flag, a daily limit (capped at 200), and a minimum gap between ads (default 130s ±20s). The SDK falls back to safe local defaults if the backend is unreachable.

You can query the current state manually:

java
GADLimitChecker.CheckResult result = GADLimitManager.getInstance().canShow();
if (!result.canShow) {
    Log.d("AdsPlus", "Blocked: " + result.reason);
}

H5 / WebView bridge

Let web pages hosted in a WebView (wallet pages, task systems) trigger native ads. Attach GADWebViewBridge to your WebView on the native side:

WalletActivity.java
java
WebView webView = findViewById(R.id.webview);
GADWebViewBridge bridge = new GADWebViewBridge(webView, this);
webView.loadUrl("https://your-server.com/wallet");

// In onDestroy()
bridge.destroy();

Load adsplus-bridge.js on your H5 page (host it alongside the page), then call the bridge:

wallet.html
html
<!-- Host adsplus-bridge.js alongside your H5 page -->
<script src="/adsplus-bridge.js"></script>
wallet.js
javascript
// Show a rewarded ad from the web page
if (AdsPlusBridge.isAdReady('rewarded')) {
    AdsPlusBridge.showRewardedAd({ taskId: 'daily_bonus', rewardAmount: 100 });
}

// React to reward completion (dispatched by the bridge)
window.addEventListener('adsplus:userRewarded', function (e) {
    var rewardType = e.detail.rewardType;
    var amount = e.detail.amount;
    // credit the user
});

Troubleshooting

  • Ads return null / not ready: create ad objects only after the init success callback — placement IDs are empty until then.
  • Init fails: verify the tenant_id is approved and the package name matches the registered app.
  • Show blocked unexpectedly: you've likely hit the daily limit or min-interval — check the frequency-cap config.
  • Enable verbose logs with setLogLevel(GADLogger.Level.DEBUG) while integrating.
adsplus.·Open ad monetization platform

© 2026 AdsPlus. All rights reserved.