Appearance
插屏广告
初始化插屏广告
version>=1.0.0
不支持java/oc直接调用
csharp
public static void InitInterstitialAd(InterstitialAdInitParam param = null);
typescript
export function initInterstitialAd(params?: AdParam): void;
AdParam参数
参数 | 类型 | 说明 | 默认值 |
---|---|---|---|
adUnitId | string | 广告位id | '' |
展示插屏广告
version>=1.0.0
不支持java/oc直接调用
csharp
public static void ShowInterstitialAd(InterstitialAdShowParam param);
typescript
export function showInterstitialAd(params: InterstitialAdShowParam): void;
InterstitialAdShowParam参数
参数 | 类型 | 说明 | 默认值 |
---|---|---|---|
adUnitId | string | 广告位id | 第一次初始化广告时的广告位id |
positionTag | string | 广告点位,用于统计 | 必传 |
timeout | int | 超时时间,单位毫秒 | 10000 |
result | Action(int) | 错误码,0: 正产关闭 -1: 加载失败 -2: 展示失败,version=1.0.x | |
extra | Object | 插屏额外打点参数,version>=1.1.0 | |
start | Action | 插屏广告开始播放回调 | |
success | Action | 正常关闭,version>=1.1.0 | |
fail | OnFail | 展示失败,version>=1.1.0 | |
complete | Action | 调用完成,version>=1.1.0 |
中断
version>=1.0.0
不支持java/oc直接调用
csharp
public static void InterruptInterstitialAd(string adUnitId = null);
typescript
export function InterruptInterstitialAd(adUnitId?: string): void;
参数说明
参数 | 类型 | 说明 | 默认值 |
---|---|---|---|
adUnitId | string | 广告位id | 第一次初始化广告时的广告位id |
- 注意事项
仅在加载阶段可以中断,广告展示后无法中断
获取当前广告位状态
version>=1.0.0
不支持java/oc直接调用
csharp
public static int GetInterstitialAdStatus(string adUnitId = null);
typescript
export function getInterstitialAdStatus(adUnitId?: string): number;
参数说明
参数 | 类型 | 说明 | 默认值 |
---|---|---|---|
adUnitId | string | 广告位id | 第一次初始化广告时的广告位id |
返回值
参数 | 类型 | 说明 | 说明 |
---|---|---|---|
int | 广告状态 | 0:空闲 1:加载中 2:展示中 |