[英]Instant game ads not working - showAsync' of null
我正在尝试将货币化添加到我的 Facebook 即时游戏中,它是通过 Cocos Creator 创建的。 我已经检查了项目设置 Facebook 受众网络,并将游戏构建为即时游戏。 (Cocos Creator 已经集成了 Facebook Instant Games SDK,它会在游戏加载时自动初始化(initializeAsync 和 startGameAsync)。)我的应用程序被批准了,我也在实时模式下尝试了广告。 我也测试了来自移动设备的浏览器广告。 插页式广告应该可以在浏览器中工作,但我仍然收到此错误:未捕获的类型错误:无法读取 null 的属性“showAsync”或插页式广告无法预加载:客户端不支持消息:getinterstitialadasync
我的代码是这样的:
showInterstitialAd: function () {
var preloadedInterstitial = null;
FBInstant.getInterstitialAdAsync(
'1111111111111' // Your Ad Placement Id
).then(function (interstitial) {
// Load the Ad asynchronously
preloadedInterstitial = interstitial;
return preloadedInterstitial.loadAsync();
}).then(function () {
console.log('Interstitial preloaded');
}).catch(function (err) {
console.error('Interstitial failed to preload: ' + err.message);
});
preloadedInterstitial.showAsync()
.then(function () {
// Perform post-ad success operation
console.log('Interstitial ad finished successfully');
})
.catch(function (e) {
console.error(e.message);
});
},
我错过了什么? 谢谢你
可能您没有遗漏任何东西,Facebook 即时游戏插页式广告只有在您通过 3K mps 后才能使用,现在您只能使用奖励视频和应用内购买。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.