开屏广告
开屏广告
此章节将演示如何请求在APICloud
环境下请求与展示开屏广告
原生开屏广告
function showSplashAd() {
var splashAd = api.require('ZJAdSDKModule');
splashAd.loadAndShowSplashAd({
adId: 'J6428742394',
fetchDelay: 5
},function(ret, err){
var event = ret.event;
console.log(event);
api.toast({
msg: event
});
if (event == 'ZJSplashAdDidLoad') {
}else if (event == 'ZJSplashAdShow'){
}else if (event == 'ZJSplashAdClicked'){
}else if (event == 'ZJSplashAdClosed'){
}else if (event == 'ZJSplashAdCountdownEnd'){
}else if (event == 'ZJSplashAdError'){
}else{
}
//ZJSplashAdDidLoad 开屏广告素材加载成功
//ZJSplashAdShow 开屏广告成功展示
//ZJSplashAdClicked 开屏广告点击回调
//ZJSplashAdClosed 开屏广告关闭回调
//ZJSplashAdCountdownEnd 开屏广告倒记时结束
//ZJSplashAdError 开屏广告错误
//ZJSplashAdWillEnterBackground 应用进入后台时回调
});
}