facebook-instant-games - 即时游戏广告不起作用 - showAsync' 为 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 后才能工作,现在你只能使用奖励视频和应用内购买。
推荐阅读
- sql - 总和字段取决于从日期开始按月和年分组
- python-3.x - 如何在 Heroku 中为 Python Flask 应用程序安装模块 flask_wtf?
- .net - 是否有 .Net API 用于获取 AzureAD 应用注册的显示名称?
- python-3.x - 如何根据 S 中的余弦距离从 P 中找到 5 个最近点
- java - 在使用 itextpdf -PdfPTable 创建 pdf 并在任何一行中添加表格时,它在底部显示黑色边框
- mysql - mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost' - 在我的 mac 重新启动后出现此错误
- java - 如何使用 JAVA ODBC 将数据写入从 SQL 查询返回的文件中
- python - 如何以逆时针方向对坐标元组列表进行排序?
- java - 在spring boot中使用多个依赖服务时如何测试服务层
- numpy - 在 numpy/pytorch 中使用 bool 数组或索引数组进行索引是否更快?