interstitialad.onclose(function listener)
基础库 或更高版本, 且 支付宝客户端 10.3.76 或更高版本。 若版本较低,建议采取 兼容处理。
以 promise 风格调用: 支持 。
主体: 企业支付宝小程序
监听插屏/全屏广告关闭事件。
用户点击关闭按钮或者点击广告内容进行跳转时,广告都将会关闭。
使用接口之前,请先到 提交审核并开通广告功能。
function listener
广告关闭事件的监听函数。
参数
object res
属性 | 类型 | 兼容性 | 描述 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | string | 基础库: 2.9.11 | 操作类型 | ||||||||||
| |||||||||||||
bizid | string | 基础库: 2.9.11 | 展位码业务id |
代码示例
const interstitialad = my.createinterstitialad({
adunitid: 'test_video' // 广告单元 id
});
// 监听广告关闭事件
interstitialad.onclose((res) => {
console.log(res.type, res.bizid);
});