Files
18xchat/assets/Scripts/Main/Channel/core/IAdSDK.ts
T
2025-09-26 17:34:07 +08:00

46 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 定义广告能力接口,所有广告 SDK 必须实现
*
*/
import { ISDK } from "./ISDK";
export interface IAdSDK extends ISDK {
/**
* 展示激励视频广告
* @param cb 回调,用户看完广告后触发
*
* - 成功播放到结尾时触发回调 → 发放奖励
* - 中途关闭时一般不触发
*/
showRewardVideo(cb: (ok: boolean) => void): void;
/**
* 展示插屏广告(splash/interstitial
*
* - 一般在关卡切换/场景切换时调用
*/
showInterstitial(): void;
/**
* 展示 Banner 广告
*
* - 通常固定在屏幕底部或顶部
*/
showBanner(): void;
/**
* 隐藏 Banner 广告
*/
hideBanner(): void;
/**
* 主动拉起分享
* @param cb 分享成功后的回调(某些平台支持)
*
* - 分享到好友/群聊
* - 不同平台回调机制不同,有的平台不保证能检测到分享成功
*/
showShare(cb?: Function): void;
}