public static loadAd_Interstitial() {//加载插屏广告对象
FBInstant.getInterstitialAdAsync(
'749104672109557_749705092049515',//Your Ad Placement Id
).then(function (interstitial) {
// Load the Ad asynchronously
FB.AgentData.adObj_Interstitial = interstitial;
return FB.AgentData.adObj_Interstitial.loadAsync();
}).then(function () {
MyDebug.log('FBInstant loadAd_Interstitial() preloaded');
FB.AgentData.showAd_Interstitial();
}).catch(function (err) {
MyDebug.error('FBInstant loadAd_Interstitial() failed to preload:' + err.message);
});
}
public static showAd_Interstitial() {//显示插屏广告对象
if (FB.AgentData.adObj_Interstitial == null) {
MyDebug.log('FBInstant showAd_Interstitial() ad=null');
return;
}
FB.AgentData.adObj_Interstitial.showAsync().then(function () {
// Perform post-ad success operation
MyDebug.log('FBInstant showAd_Interstitial() ad finished successfully');
}).catch(function (e) {
MyDebug.error('FBInstant showAd_Interstitial() failed:' + e.message);
});
}
public static preload_RewardedVideo(adId) {//提前加载激励视频广告对象