简体   繁体   中英

Instant game ads not working - showAsync' of null

I am trying to add monetization to my Facebook instant game, it is created via Cocos Creator. I have checked in project settings Facebook audience network and also build game as instant game. (Cocos Creator has integrated the Facebook Instant Games SDK and it automatically initializes (initializeAsync and startGameAsync) when the game is loaded.) My app was approved and I tried ads also in live mode. I tested ads from browser also from mobile. Interstitial ads should work from browser but I am still getting this error: Uncaught TypeError: Cannot read property 'showAsync' of null or Interstitial failed to preload: Client does not support the message: getinterstitialadasync

my code looks like this:

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);
        });
},

What am I missing? thank you

可能您没有遗漏任何东西,Facebook 即时游戏插页式广告只有在您通过 3K mps 后才能使用,现在您只能使用奖励视频和应用内购买。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM