簡體   English   中英

即時游戲廣告不起作用 - showAsync' of null

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM