问题描述
我正在尝试通过Cocos Creator创建货币,将其添加到我的Facebook即时游戏中。我已经签入了项目设置Facebook观众网络,并且还将游戏构建为即时游戏。 (Cocos Creator已集成了Facebook Instant Games SDK,并且在加载游戏时会自动初始化(initializeAsync和startGameAsync)。)我的应用程序已获批准,并且还在实时模式下尝试了广告。我测试了来自浏览器的广告以及来自移动设备的广告。插页式广告应该可以在浏览器上运行,但仍然出现此错误: 未捕获的TypeError:无法读取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 mp后才能工作,现在您只能使用奖励视频和应用内购买。