| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908 |
- declare namespace topon {
- interface ParamMap {
- os_vn?: string;
- os_vc?: string;
- package_name?: string;
- app_vn?: string;
- app_vc?: string;
- brand?: string;
- model?: string;
- screen?: string;
- mnc?: string;
- mcc?: string;
- language?: string;
- timezone?: string;
- ua?: string;
- orient?: string;
- network_type?: string;
- it_src?: string;
- android_id?: string;
- gaid?: string;
- mac?: string;
- imei?: string;
- oaid?: string;
- idfa?: string;
- idfv?: string;
- [name: string]: any;
- }
- type UserLocationCallback = (status: 0 | 1 | 2) => void;
- enum GDPRLevel {
- PERSONALIZED = 0,
- NONPERSONALIZED = 1,
- UNKNOWN = 2
- }
- interface AdInfo {
- /**
- * @en
- * A unique ID generated every time an ad is displayed
- * @zh
- * 每次展示广告时生成的独立ID
- */
- id: number;
- /**
- * @en
- * Display income, the unit can be obtained by currency, and the precision can be obtained by precision
- * @zh
- * 展示收益,单位可通过 currency 获取, 精度可通过 precision 获取
- */
- publisher_revenue: number;
- /**
- * @en
- * Currency unit, for example: "USD"
- * @zh
- * 货币单位,例如:"USD"
- */
- currency: string;
- /**
- * @en
- * Country code, for example: "CN"
- * @zh
- * 国家代码, 例如:”CN"
- */
- country: string;
- /**
- * @en
- * TopOn Advertising Slot ID
- * @zh
- * TopOn 广告位ID
- */
- adunit_id: string;
- /**
- * @en
- * Advertising types, including: "Native", "RewardedVideo", "Banner", "Interstitial", "Splash"
- * @zh
- * 广告类型,包括:"Native"、"RewardedVideo"、"Banner"、"Interstitial"、"Splash"
- */
- adunit_format: "Native" | "RewardedVideo" | "Banner" | "Interstitial" | "Splash";
- /**
- * @en
- * ECPM accuracy
- *
- * "publisher_defined": The eCPM defined by the developer for the advertising source in the TopOn backend (cross-promotion eCPM also belongs to this type)
- *
- * "estimated": The eCPM calculated by TopOn based on historical data after the automatic price function of advertising sources is turned on in the TopOn background
- *
- * "exact": eCPM for real-time bidding
- * @zh
- * ECPM精度
- *
- * "publisher_defined":开发者在TopOn后台为广告源定义的eCPM(交叉推广的eCPM也属于该类型)
- *
- * "estimated": 在TopOn后台开启广告源的自动价格功能后,TopOn根据历史数据计算出的eCPM
- *
- * "exact":实时竞价的eCPM
- */
- precision: "publisher_defined" | "estimated" | "exact";
- /**
- * @en
- * Network type
- *
- * "Network": Third-party advertising platform
- *
- * "Cross_Promotion": Interactive promotion
- *
- * "Adx": TopOn Adx
- * @zh
- * Network类型
- *
- * "Network":第三方广告平台
- *
- * "Cross_Promotion":交互推广
- *
- * "Adx":TopOn Adx
- */
- network_type: "Network" | "Cross_Promotion" | "Adx";
- /**
- * @en
- * @zh
- * 广告平台的广告位 ID
- */
- network_placement_id: string;
- /**
- * @en
- * Ad slot ID of the advertising platform
- * @zh
- * 广告源的eCPM层级(对应开发者后台聚合管理页面的优先级),头部竞价广告源默认为0
- */
- ecpm_level: number;
- /**
- * @en
- * Traffic group ID
- * @zh
- * 流量分组 ID
- */
- segment_id: number;
- /**
- * @en
- * @zh
- * 广告场景 ID,仅 RewardVideo、Interstitial 支持
- */
- scenario_id: string;
- /**
- * @en
- * Ad scene ID, only supported by RewardVideo and Interstitial
- * @zh
- * 广告场景的激励名称,仅 RewardeVideo 支持
- */
- scenario_reward_name: string;
- /**
- * @en
- * The number of incentives for advertising scenes, only supported by RewardVideo
- * @zh
- * 广告场景的激励数量,仅 RewardVideo 支持
- */
- scenario_reward_number: number;
- /**
- * @en
- * Channel information
- * @zh
- * 渠道信息
- */
- channel: string;
- /**
- * @en
- * Json string of custom rule of Placement+App dimension
- * @zh
- * Placement+App维度的自定义规则的Json字符串
- */
- sub_channel: string;
- /**
- * @en
- * Custom rules of Placement+App dimension
- * @zh
- * Placement+App维度的自定义规则
- */
- custom_rule: {
- [name: string]: any;
- };
- /**
- * @en
- * The ID corresponding to the advertising platform, used to distinguish the advertising platform. Refer to https://docs.toponad.com/#/zh-cn/android/android_doc/android_sdk_callback_access?id=network_firm_id
- * @zh
- * 广告平台对应的ID,用于区分广告平台,参考 https://docs.toponad.com/#/zh-cn/android/android_doc/android_sdk_callback_access?id=network_firm_id
- */
- network_firm_id: number;
- /**
- * @en
- * Advertising source ID. The specific network information can be queried through the advertising source ID in the developer background or TopOn Open API
- * @zh
- * 广告源 ID. 可在开发者后台或 TopOn Open API 通过广告源 ID 查询具体的 Network 信息
- */
- adsource_id: string;
- /**
- * @en
- * The current ranking of ad sources in WaterFall (starting from 0, 0 has the highest priority)
- * @zh
- * 当前广告源在 WaterFall 中的排序(从0开始,0优先级最高)
- */
- adsource_index: number;
- /**
- * @en
- * eCPM, currency acquisition, precision can be acquired through precision
- * @zh
- * eCPM,currency 获取, 精度可通过 precision 获取
- */
- adsource_price: number;
- /**
- * @en
- * Whether it is the advertising source of the head bidding, 1: Yes, 2: No
- * @zh
- * 是否为头部竞价的广告源,1:是,2:否
- */
- adsource_isheaderbidding: 1 | 2;
- /**
- * @en
- * Advertising custom information, for Adx, OnlineAPI and custom advertising platform, Adx, OnlineAPI related key reference
- * @zh
- * 广告的自定义信息,针对Adx、OnlineAPI以及自定义广告平台,Adx、OnlineAPI相关Key参考
- */
- ext_info: {
- /**
- * @en
- * Advertising ID of Adx & OnlineAPI Offer
- * @zh
- * Adx & OnlineAPI Offer的广告 ID
- */
- offer_id: string;
- /**
- * @en
- * Material ID of Adx & OnlineAPI Offer
- * @zh
- * Adx & OnlineAPI Offer的素材 ID
- */
- creative_id: string;
- /**
- * @en
- * Determine whether the order type of Adx & OnlineAPI Offer is a Deeplink or JumpURL order 0: No, 1: Yes
- * @zh
- * 判断Adx & OnlineAPI Offer的单子类型是否为Deeplink或JumpURL的单子 0: 否、1: 是
- */
- is_deeplink: 0 | 1;
- network_id: string;
- network_unit_id: string;
- network_ecpm: string;
- [name: string]: any;
- };
- reward_custom_data: {
- [name: string]: any;
- };
- }
- interface AdStatus {
- isLoading: boolean;
- isReady: boolean;
- adInfo: AdInfo;
- }
- interface BannerListener {
- onBannerAdLoaded?: () => void;
- onBannerAdFailed?: (errorInfo: any) => void;
- onBannerAdClicked?: (adInfo: AdInfo) => void;
- onBannerAdShow?: (adInfo: AdInfo) => void;
- onBannerAdClose?: (adInfo: AdInfo) => void;
- onBannerAdAutoRefreshed?: (adInfo: AdInfo) => void;
- onBannerAdAutoRefreshFail?: (errorInfo: any) => void;
- onBannerAdCloseButtonTapped?: (adInfo: AdInfo) => void;
- onDeeplinkCallback?: (adInfo: AdInfo, isSuccess: boolean) => void;
- }
- interface InterstitialListener {
- onInterstitialAdLoaded?: () => void;
- onInterstitialAdLoadFail?: (errorInfo: any) => void;
- onInterstitialAdClicked?: (adInfo: AdInfo) => void;
- onInterstitialAdShow?: (adInfo: AdInfo) => void;
- onInterstitialAdClose?: (adInfo: AdInfo) => void;
- onInterstitialAdVideoStart?: (adInfo: AdInfo) => void;
- onInterstitialAdVideoEnd?: (adInfo: AdInfo) => void;
- onInterstitialAdVideoError?: (errorInfo: any) => void;
- onInterstitialAdFailedToShow?: (errorInfo: any, adInfo: AdInfo) => void;
- onDeeplinkCallback?: (adInfo: AdInfo, isSuccess: boolean) => void;
- }
- interface NativeListener {
- onNativeAdLoaded?: () => void;
- onNativeAdLoadFail?: (errorInfo: any) => void;
- onNativeAdShow?: (adInfo: AdInfo) => void;
- onNativeAdClick?: (adInfo: AdInfo) => void;
- onNativeAdVideoStart?: () => void;
- onNativeAdVideoEnd?: () => void;
- onNativeAdVideoProgress?: (progress: number) => void;
- onNativeAdCloseButtonClick?: (adInfo: AdInfo) => void;
- onDeeplinkCallback?: (adInfo: AdInfo, isSuccess: boolean) => void;
- }
- interface RewardVideoListener {
- onRewardedVideoAdLoaded?: () => void;
- onRewardedVideoAdFailed?: (errorInfo: any) => void;
- onRewardedVideoAdPlayStart?: (adInfo: AdInfo) => void;
- onRewardedVideoAdPlayEnd?: (adInfo: AdInfo) => void;
- onRewardedVideoAdPlayFailed?: (errorInfo: any, adInfo: AdInfo) => void;
- onRewardedVideoAdClosed?: (adInfo: AdInfo) => void;
- onRewardedVideoAdPlayClicked?: (adInfo: AdInfo) => void;
- onReward?: (adInfo: AdInfo) => void;
- onDeeplinkCallback?: (adInfo: AdInfo, isSuccess: boolean) => void;
- }
- class NativeViewItem {
- x: number;
- y: number;
- width: number;
- height: number;
- backgroundColor: string;
- textColor: string;
- textSize: number;
- constructor(x: number, y: number, width: number, height: number, backgroundColor: string, textColor: string, textSize: number);
- }
- class NativeViewProperty {
- parent: NativeViewItem | undefined;
- appIcon: NativeViewItem | undefined;
- mainImage: NativeViewItem | undefined;
- title: NativeViewItem | undefined;
- desc: NativeViewItem | undefined;
- adLogo: NativeViewItem | undefined;
- cta: NativeViewItem | undefined;
- rating: NativeViewItem | undefined;
- }
- namespace JSB {
- function fullClassName(sampleClassName: string): string;
- function callNativeMethod(className: string, methodName: string, ...parameters: any): any;
- function isAndroid(): boolean;
- function isIOS(): boolean;
- }
- namespace Base {
- interface Base {
- getPlacementId(): string;
- }
- interface Banner extends Base {
- loadBanner(settings: string): void;
- isAdReady(): boolean;
- showAdInPosition(position: string): void;
- showAdInRectangle(rect: string): void;
- removeAd(): void;
- reshowAd(): void;
- hideAd(): void;
- }
- interface RewardVideo extends Base {
- loadRewardVideo(settings: string): void;
- showAd(scenario?: string): void;
- isAdReady(): boolean;
- checkAdStatus(): string;
- }
- interface Interstitial extends Base {
- loadInterstitial(settings: string): void;
- showAd(scenario?: string): void;
- isAdReady(): boolean;
- checkAdStatus(): string;
- }
- interface Native extends Base {
- loadNative(settings: string): void;
- isAdReady(): boolean;
- showAd(adViewProperty: string): void;
- removeAd(): void;
- clean(): void;
- }
- interface TopOnAd {
- initCustomMap(customMap: string): void;
- setPlacementCustomMap(placmentId: string, customMap: string): void;
- setGDPRLevel(level: number): void;
- getGDPRLevel(): number;
- getUserLocation(): void;
- showGDPRAuth(): void;
- setLogDebug(debug: boolean): void;
- deniedUploadDeviceInfo(deniedInfo: string): void;
- integrationChecking(): void;
- }
- }
- namespace Android {
- class Banner implements Base.Banner {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadBanner(settings: string): void;
- isAdReady(): boolean;
- showAdInPosition(position: string): void;
- showAdInRectangle(rect: string): void;
- removeAd(): void;
- reshowAd(): void;
- hideAd(): void;
- }
- class Interstitial implements Base.Interstitial {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadInterstitial(settings: string): void;
- showAd(scenario?: string): void;
- isAdReady(): boolean;
- checkAdStatus(): string;
- }
- class Native implements Base.Native {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadNative(settings: string): void;
- isAdReady(): boolean;
- showAd(adViewProperty: string): void;
- removeAd(): void;
- clean(): void;
- }
- class RewardVideo implements Base.RewardVideo {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadRewardVideo(settings: string): void;
- showAd(scenario?: string): void;
- isAdReady(): boolean;
- checkAdStatus(): string;
- }
- class TopOnAd implements Base.TopOnAd {
- className: string;
- constructor();
- initCustomMap(customMap: string): void;
- setPlacementCustomMap(placmentId: string, customMap: string): void;
- setGDPRLevel(level: number): void;
- getGDPRLevel(): number;
- getUserLocation(): void;
- showGDPRAuth(): void;
- setLogDebug(debug: boolean): void;
- deniedUploadDeviceInfo(deniedInfo: string): void;
- integrationChecking(): void;
- }
- }
- namespace iOS {
- class Banner implements Base.Banner {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadBanner(settings: string): void;
- isAdReady(): boolean;
- showAdInPosition(position: string): void;
- showAdInRectangle(rect: string): void;
- removeAd(): void;
- reshowAd(): void;
- hideAd(): void;
- }
- class Interstitial implements Base.Interstitial {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadInterstitial(settings: string): void;
- showAd(scenario?: string): void;
- isAdReady(): boolean;
- checkAdStatus(): string;
- }
- class Native implements Base.Native {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadNative(settings: string): void;
- isAdReady(): boolean;
- showAd(adViewProperty: string): void;
- removeAd(): void;
- clean(): void;
- }
- class RewardVideo implements Base.RewardVideo {
- placementId: string;
- className: string;
- constructor(placementId: string);
- getPlacementId(): string;
- loadRewardVideo(settings: string): void;
- showAd(scenario?: string): void;
- isAdReady(): boolean;
- checkAdStatus(): string;
- }
- class TopOnAd implements Base.TopOnAd {
- className: string;
- constructor();
- initCustomMap(customMap: string): void;
- setPlacementCustomMap(placmentId: string, customMap: string): void;
- setGDPRLevel(level: number): void;
- getGDPRLevel(): number;
- getUserLocation(): void;
- showGDPRAuth(): void;
- setLogDebug(debug: boolean): void;
- deniedUploadDeviceInfo(deniedInfo: string): void;
- integrationChecking(): void;
- }
- }
- namespace Listener {
- function parseCallbackInfo(callbackInfo: string): AdInfo;
- const TopOn: {
- userLocationCallback: UserLocationCallback;
- setCallback(cb: UserLocationCallback): void;
- onUserLocation(status: 0 | 1 | 2): void;
- };
- const Banner: {
- listenerMap: Map<string, BannerListener>;
- setListener(placementId: string, listener: BannerListener): void;
- onBannerAdLoaded(placementId: string): void;
- onBannerAdFailed(placementId: string, errorInfo: string): void;
- onBannerAdClicked(placementId: string, callbackInfo: string): void;
- onBannerAdShow(placementId: string, callbackInfo: string): void;
- onBannerAdClose(placementId: string, callbackInfo: string): void;
- onBannerAdAutoRefreshed(placementId: string, callbackInfo: string): void;
- onBannerAdAutoRefreshFail(placementId: string, errorInfo: string): void;
- onBannerAdCloseButtonTapped(placementId: string, callbackInfo: string): void;
- onDeeplinkCallback(placementId: string, callbackInfo: string, isSuccess: string): void;
- };
- const Interstitial: {
- listenerMap: Map<string, InterstitialListener>;
- setListener(placementId: string, listener: InterstitialListener): void;
- onInterstitialAdLoaded(placementId: string): void;
- onInterstitialAdLoadFail(placementId: string, errorInfo: string): void;
- onInterstitialAdClicked(placementId: string, callbackInfo: string): void;
- onInterstitialAdShow(placementId: string, callbackInfo: string): void;
- onInterstitialAdClose(placementId: string, callbackInfo: string): void;
- onInterstitialAdVideoStart(placementId: string, callbackInfo: string): void;
- onInterstitialAdVideoEnd(placementId: string, callbackInfo: string): void;
- onInterstitialAdVideoError(placementId: string, errorInfo: string): void;
- onInterstitialAdFailedToShow(placementId: string, errorInfo: string, callbackInfo: string): void;
- onDeeplinkCallback(placementId: string, callbackInfo: string, isSuccess: string): void;
- };
- const Native: {
- listenerMap: Map<string, NativeListener>;
- setListener(placementId: string, listener: NativeListener): void;
- onNativeAdLoaded(placementId: string): void;
- onNativeAdLoadFail(placementId: string, errorInfo: string): void;
- onNativeAdShow(placementId: string, callbackInfo: string): void;
- onNativeAdClick(placementId: string, callbackInfo: string): void;
- onNativeAdVideoStart(placementId: string): void;
- onNativeAdVideoEnd(placementId: string): void;
- onNativeAdVideoProgress(placementId: string, progress: string): void;
- onNativeAdCloseButtonClick(placementId: string, callbackInfo: string): void;
- onDeeplinkCallback(placementId: string, callbackInfo: string, isSuccess: string): void;
- };
- const RewardVideo: {
- listenerMap: Map<string, RewardVideoListener>;
- setListener(placementId: string, listener: RewardVideoListener): void;
- onRewardedVideoAdLoaded(placementId: string): void;
- onRewardedVideoAdFailed(placementId: string, errorInfo: string): void;
- onRewardedVideoAdPlayStart(placementId: string, callbackInfo: string): void;
- onRewardedVideoAdPlayEnd(placementId: string, callbackInfo: string): void;
- onRewardedVideoAdPlayFailed(placementId: string, errorInfo: string, callbackInfo: string): void;
- onRewardedVideoAdClosed(placementId: string, callbackInfo: string): void;
- onRewardedVideoAdPlayClicked(placementId: string, callbackInfo: string): void;
- onReward(placementId: string, callbackInfo: string): void;
- onDeeplinkCallback(placementId: string, callbackInfo: string, isSuccess: string): void;
- };
- }
- class Banner {
- banner: Base.Banner | undefined;
- constructor(placementId: string);
- /**
- * @en
- * Load ad
- * @zh
- * 加载广告
- * @param settings Additional settings for ads
- */
- loadBanner(settings?: {
- banner_ad_size_struct?: {
- width: number;
- height: number;
- };
- width?: number;
- height?: number;
- adaptive_width?: number;
- adaptive_orientation?: 0 | 1 | 2;
- inline_adaptive_width?: number;
- inline_adaptive_orientation?: 0 | 1 | 2;
- }): void;
- /**
- * @en
- * Check if the ad is ready
- * @zh
- * 检查广告是否准备就绪
- * @returns Is it ready
- */
- isAdReady(): boolean;
- /**
- * @en
- * Show ads in designated locations
- * @zh
- * 在指定的位置显示广告
- * @param position Display position
- */
- showAdInPosition(position: 'top' | 'bottom'): void;
- /**
- * @en
- * Display ads in the designated advertising area
- * @zh
- * 在指定的广告区域显示广告
- * @param rect Display area
- */
- showAdInRectangle(rect: {
- x: number;
- y: number;
- width: number;
- height: number;
- }): void;
- /**
- * @en
- * Remove ads
- * @zh
- * 移除广告
- */
- removeAd(): void;
- /**
- * @en
- * Redisplay the ad after hiding it
- * @zh
- * 在隐藏之后重新显示广告
- */
- reshowAd(): void;
- /**
- * @en
- * Hide ads
- * @zh
- * 隐藏广告
- */
- hideAd(): void;
- /**
- * @en
- * Set up ad listener
- * @zh
- * 设置广告监听器
- * @param listener Ad listener
- */
- setAdListener(listener: BannerListener): void;
- }
- class Interstitial {
- interstitial: Base.Interstitial | undefined;
- constructor(placementId: string);
- /**
- * @en
- * Load ad
- * @zh
- * 加载广告
- * @param settings Additional settings for ads
- */
- loadInterstitial(settings?: {
- UseRewardedVideoAsInterstitial: boolean;
- }): void;
- /**
- * @en
- * Show ads
- * @zh
- * 显示广告
- * @param scenario Advertising scene
- */
- showAd(scenario?: string): void;
- /**
- * @en
- * Check if the ad is ready
- * @zh
- * 检查广告是否准备就绪
- * @returns Is it ready
- */
- isAdReady(): boolean;
- /**
- * @en
- * Get the ad status information of the current ad
- * @zh
- * 获取当前广告的广告状态信息
- * @returns Ad status
- */
- checkAdStatus(): AdStatus | undefined;
- /**
- * @en
- * Set up ad listener
- * @zh
- * 设置广告监听器
- * @param listener Ad listener
- */
- setAdListener(listener: InterstitialListener): void;
- }
- class Native {
- native: Base.Native | undefined;
- constructor(placementId: string);
- /**
- * @en
- * Load ad
- * @zh
- * 加载广告
- * @param settings Additional settings for ads
- */
- loadNative(settings?: {
- width: number;
- height: number;
- }): void;
- /**
- * @en
- * Check if the ad is ready
- * @zh
- * 检查广告是否准备就绪
- * @returns Is it ready
- */
- isAdReady(): boolean;
- /**
- * @en
- * Show ads
- * @zh
- * 显示广告
- * @param adViewProperty Advertisement display interface configuration
- */
- showAd(adViewProperty: NativeViewProperty): void;
- /**
- * @en
- * Remove ads
- * @zh
- * 移除广告
- */
- removeAd(): void;
- /**
- * @en
- * Remove the binding of the ad
- * @zh
- * 移除广告的绑定
- */
- clean(): void;
- /**
- * @en
- * Set up ad listener
- * @zh
- * 设置广告监听器
- * @param listener Ad listener
- */
- setAdListener(listener: NativeListener): void;
- }
- class RewardVideo {
- rewardVideo: Base.RewardVideo | undefined;
- constructor(placementId: string);
- /**
- * @en
- * Load ad
- * @zh
- * 加载广告
- * @param settings Additional settings for ads
- */
- loadRewardVideo(settings?: {
- userID: string;
- media_ext: string;
- }): void;
- /**
- * @en
- * Show ads
- * @zh
- * 显示广告
- * @param scenario Advertising scene
- */
- showAd(scenario?: string): void;
- /**
- * @en
- * Check if the ad is ready
- * @zh
- * 检查广告是否准备就绪
- * @returns Is it ready
- */
- isAdReady(): boolean;
- /**
- * @en
- * @zh
- * 获取当前广告的广告状态信息
- * @returns 广告状态
- */
- checkAdStatus(): AdStatus | undefined;
- /**
- * @en
- * Set up ad listener
- * @zh
- * 设置广告监听器
- * @param listener Ad listener
- */
- setAdListener(listener: RewardVideoListener): void;
- }
- class TopOnAd {
- toponAd: Base.TopOnAd | undefined;
- constructor();
- /**
- * @en
- * The custom rules of the App are global settings and are valid for all Placements.
- *
- * Developers can set corresponding custom rules in the traffic grouping in the TopOn background, refer to the traffic grouping instructions (https://docs.toponad.com/#/zh-cn/android/NetworkAccess/SegmentAccess/segment_access_doc.md )
- * @zh
- * App的自定义规则为全局设置,对全部Placement有效.
- *
- * 开发者可以在TopOn后台的流量分组中设置相应的自定义规则,具体 参考流量分组使用说明(https://docs.toponad.com/#/zh-cn/android/NetworkAccess/SegmentAccess/segment_access_doc.md)
- * @param customMap Custom key-value, which can be used to match the advertisement list information issued by the backend in App dimension
- */
- initCustomMap(customMap: ParamMap): void;
- /**
- * @en
- * Only valid for the current Placement, you can add custom rules specific to the Placement on the basis of the App custom rules.
- *
- * Developers can set corresponding custom rules in the traffic grouping in the TopOn background, refer to the traffic grouping instructions (https://docs.toponad.com/#/zh-cn/android/NetworkAccess/SegmentAccess/segment_access_doc.md )
- * @zh
- * 仅对当前Placement有效,您可以在App自定义规则基础上增加Placement特有的自定义规则.
- *
- * 开发者可以在TopOn后台的流量分组中设置相应的自定义规则,具体 参考流量分组使用说明(https://docs.toponad.com/#/zh-cn/android/NetworkAccess/SegmentAccess/segment_access_doc.md)
- * @param placmentId Current placementId
- * @param customMap Custom key-value, which can be used to match the advertisement list information issued by the backend in App dimension
- */
- setPlacementCustomMap(placmentId: string, customMap: ParamMap): void;
- /**
- * @en
- * Set the reporting level of data under GDPR
- * @zh
- * 设置 GDPR 下数据的上报等级
- * @param level level
- */
- setGDPRLevel(level: GDPRLevel): void;
- /**
- * @en
- * Get the current escalation level
- * @zh
- * 获取当前的上报等级
- * @returns Current escalation level
- */
- getGDPRLevel(): GDPRLevel;
- /**
- * @en
- * Check the current network area
- * @zh
- * 检查当前的网络的区域
- * @param callback Callback
- */
- getUserLocation(callback: UserLocationCallback): void;
- /**
- * @en
- * Display the GDPR authorization page
- * @zh
- * 展示GDPR授权页面
- */
- showGDPRAuth(): void;
- /**
- * @en
- * Set whether there is Debug log output. It is recommended to open during the testing phase to facilitate verification of the advertising callback status
- * @zh
- * 设置是否有Debug日志输出。建议在测试阶段打开,方便验证广告回调状态
- * @param debug Whether to output log
- */
- setLogDebug(debug: boolean): void;
- /**
- * @en
- * Limit the collection of private data,
- *
- * For iOS see https://docs.toponad.com/#/zh-cn/ios/ios_doc/ios_sdk_init_access?id=_6-%e9%9a%90%e7%a7%81%e6%95%b0%e6% 8d%ae%e8%af%b4%e6%98%8e
- *
- * Android see https://docs.toponad.com/#/zh-cn/android/android_doc/android_sdk_init_access
- * @zh
- *
- * 限制隐私数据收集,
- *
- * iOS 参见 https://docs.toponad.com/#/zh-cn/ios/ios_doc/ios_sdk_init_access?id=_6-%e9%9a%90%e7%a7%81%e6%95%b0%e6%8d%ae%e8%af%b4%e6%98%8e
- *
- * Android 参见 https://docs.toponad.com/#/zh-cn/android/android_doc/android_sdk_init_access
- * @param deniedInfo Restricted privacy name
- */
- deniedUploadDeviceInfo(deniedInfo: string): void;
- /**
- * @en
- * Check the integration status of the advertising platform
- * @zh
- * 检查广告平台的集成状态
- */
- integrationChecking(): void;
- /**
- * @en
- * Get Banner ad object
- * @zh
- * 获取 Banner 广告对象
- * @param placementId placementId
- * @param listener Callback listener, if it is not passed, it must be displayed by calling the setAdListener method of the returned object, otherwise the advertisement callback will not be accepted
- * @returns Advertising target
- */
- getBanner(placementId: string, listener?: BannerListener): Banner;
- /**
- * @en
- * Get Interstitial ad object
- * @zh
- * 获取 Interstitial 广告对象
- * @param placementId placementId
- * @param listener Callback listener, if it is not passed, it must be displayed by calling the setAdListener method of the returned object, otherwise the advertisement callback will not be accepted
- * @returns Advertising target
- */
- getInterstitial(placementId: string, listener?: InterstitialListener): Interstitial;
- /**
- * @en
- * Get Native ad object
- * @zh
- * 获取 Native 广告对象
- * @param placementId placementId
- * @param listener Callback listener, if it is not passed, it must be displayed by calling the setAdListener method of the returned object, otherwise the advertisement callback will not be accepted
- * @returns Advertising target
- */
- getNative(placementId: string, listener?: NativeListener): Native;
- /**
- * @en
- * Get RewardVideo ad object
- * @zh
- * 获取 RewardVideo 广告对象
- * @param placementId placementId
- * @param listener Callback listener, if it is not passed, it must be displayed by calling the setAdListener method of the returned object, otherwise the advertisement callback will not be accepted
- * @returns Advertising target
- */
- getRewardVideo(placementId: string, listener?: RewardVideoListener): RewardVideo;
- }
- const toponService: TopOnAd;
- }
|