EddyVerbruggen / nativescript-admob

NativeScript plugin to earn some precious :moneybag::moneybag: with ads by Google AdMob
MIT License
69 stars 26 forks source link

Just Testing: Fails on Interstitial BUT Banner and Video works! #90

Open ghost opened 3 years ago

ghost commented 3 years ago

I just copied the code while I can set Banner and Video (in testing mode) and it works like a charm, But Interstitial fails as:

JS: Treating this deviceId as testdevice: 9627E477BBDDCCD2352E6BB85F8C052E
JS: onAdFailedToLoad: 3
JS: admob createInterstitial error: 3

and here is the code:

    admob.createInterstitial( {
        testing: true,
        androidInterstitialId: "", // add your own
        keywords: ["keyword1", "keyword2"], // add keywords for ad targeting
        onAdClosed: function () { console.log("interstitial closed") }
    } ).then(
        function() {
            console.log("admob createInterstitial done");
        },
        function(error) {
            console.log("admob createInterstitial error: " + error);
        }
    )

p.s. {N} v. 7

ghost commented 3 years ago

this works btw:

    admob.preloadRewardedVideoAd({
        testing: true,
        iosAdPlacementId: "ca-app-pub-XXXXXX/YYYYY2", // add your own
        androidAdPlacementId: "ca-app-pub-AAAAAAAA/BBBBBB2", // add your own
        keywords: ["keyword1", "keyword2"], // add keywords for ad targeting
    }).then(
        function() {

            admob.showRewardedVideoAd({
                onRewarded: (reward) => {
                    console.log("onRewarded");
                    this.message = "watched rewarded video";
                },
                onRewardedVideoAdLeftApplication: () => console.log("onRewardedVideoAdLeftApplication"),
                onRewardedVideoAdClosed: () => console.log("onRewardedVideoAdClosed"),
                onRewardedVideoAdOpened: () => console.log("onRewardedVideoAdOpened"),
                onRewardedVideoStarted: () => console.log("onRewardedVideoStarted"),
                onRewardedVideoCompleted: () => console.log("onRewardedVideoCompleted"),
            }).then(
                function() {
                    console.log("RewardedVideoAd showing");
                },
                function(error) {
                    console.log("admob showRewardedVideoAd error: " + error);
                }
            )

        },
        function(error) {
            console.log("admob preloadRewardedVideoAd error: " + error);
        }
    )

I can not figure it out why Interstitial fails, but any other methods just work as expected.

rob4226 commented 3 years ago

Did you ever figure it out? I can't even get a banner to show. The only thing I could get working was the reward video when using the preload reward video code like you have posted.