Menu

Fully automatic loading

💡Tips

  • The fully automatic loading mode is a one-stop request maintenance solution launched by TopOn. It can intelligently determine the timing for preloading and caching the next ad at multiple nodes based on the user's usage status and the progress of ad consumption. While adhering to your operational strategies, it avoids the risks of real-time ad data loading failures and wasted display opportunities, reducing the negative impact on users due to ads not loading or loading smoothly. With the fully automatic loading solution, you can avoid repetitive and cumbersome manual intervention in the request process, resulting in immediately noticeable efficiency improvements.

● Rewarded Ads


typescript Copy
import {ATRewardedVideoAutoAdSDK} from "db://assets/script/AnyThinkAds/ATRewardedAutoVideo";

let rewardedIds: string[] = ["your placement id1", "your placement id2"];
ATRewardedVideoAutoAdSDK.addPlacementIds(rewardedIds);

2. Setting the Listener

typescript Copy
private AutoRewardedVideoListener = {
    onRewardedVideoAdLoaded: (placementId: any) => {
        console.log("onRewardedVideoAdLoaded", placementId)
    },
    onRewardedVideoAdFailed: (placementId: any, errorInfo: any) => {
        console.log("onRewardedVideoAdFailed", placementId, errorInfo)
    },
    onRewardedVideoAdPlayStart: (placementId: any, callbackInfo: any) => {
        console.log("onRewardedVideoAdPlayStart", placementId, callbackInfo)
    },
    onRewardedVideoAdPlayEnd: (placementId: any, callbackInfo: any) => {
        console.log("onRewardedVideoAdPlayEnd", placementId, callbackInfo)
    },
    onRewardedVideoAdPlayFailed: (placementId: any, errorInfo: any, callbackInfo: any) => {
        console.log("onRewardedVideoAdPlayFailed", placementId, callbackInfo, errorInfo)
    },
    onRewardedVideoAdClosed: (placementId: any, callbackInfo: any) => {
        console.log("onRewardedVideoAdClosed", placementId, callbackInfo)
    },
    onRewardedVideoAdPlayClicked: (placementId: any, callbackInfo: any) => {
        console.log("onRewardedVideoAdPlayClicked", placementId)
    },
    onReward: (placementId: any, callbackInfo: any) => {
        console.log("onReward", placementId, callbackInfo)
    }
};

ATRewardedVideoAutoAdSDK.setAdListener(this.AutoRewardedVideoListener);

typescript Copy
ATRewardedVideoAutoAdSDK.entryAdScenario("your placement id", "your scenario id")
if (ATRewardedVideoAutoAdSDK.hasAdReady("your placement id")) {
    ATRewardedVideoAutoAdSDK.showAdInScenario("your placement id", "your scenario id");
}

● Interstitial Ads


typescript Copy
import {ATInterstitialAutoAdSDK} from "db://assets/script/AnyThinkAds/ATInterstitialAuto";

let InterstitialIds: string[] = ["your placement id1", "your placement id2"];
ATInterstitialAutoAdSDK.addPlacementIds(InterstitialIds);

2. Setting the Listener

typescript Copy
private AutoInterstitialListener = {
    onInterstitialAdLoaded: (placementId: any) => {
        console.log("onInterstitialAdLoaded", placementId);
    },
    onInterstitialAdLoadFail: (placementId: any, errorInfo: any) => {
        console.log("onInterstitialAdLoadFail", placementId, errorInfo);
    },
    onInterstitialAdShow: (placementId: any, callbackInfo: any) => {
        console.log("onInterstitialAdShow", placementId, callbackInfo);
    },
    onInterstitialAdStartPlayingVideo: (placementId: any, callbackInfo: any) => {
        console.log("onInterstitialAdStartPlayingVideo", placementId, callbackInfo);
    },
    onInterstitialAdEndPlayingVideo: (placementId: any, callbackInfo: any) => {
        console.log("onInterstitialAdEndPlayingVideo", placementId, callbackInfo);
    },
    onInterstitialAdFailedToPlayVideo: (placementId: any, errorInfo: any) => {
        console.log("onInterstitialAdFailedToPlayVideo", placementId, errorInfo);
    },
    onInterstitialAdFailedToShow: (placementId: any, errorInfo: any, callbackInfo: any) => {
        console.log("onInterstitialAdFailedToShow", placementId, callbackInfo, errorInfo);
    },
    onInterstitialAdClose: (placementId: any, callbackInfo: any) => {
        console.log("onInterstitialAdClose", placementId, callbackInfo);
    },
    onInterstitialAdClick: (placementId: any, callbackInfo: any) => {
        console.log("onInterstitialAdClick", placementId, callbackInfo);
    }
};

ATInterstitialAutoAdSDK.setAdListener(this.AutoInterstitialListener);

typescript Copy
ATInterstitialAutoAdSDK.entryAdScenario("your placement id", "your scenario id");
if (ATInterstitialAutoAdSDK.hasAdReady("your placement id")) {
    ATInterstitialAutoAdSDK.showAdInScenario("your placement id", "your scenario id");
}

Previous
Privacy Policy
Next
Advanced Features
Last modified: 2025-06-04Powered by