Instant game ads not working - showAsync' of null

481 views Asked by At

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

1

There are 1 answers

0
Jamel Aquel On

probably you are not missing anything, Facebook instant games interstitials only work after you pass the 3K mps, right now you only cam use reward videos and In-app-purchase.