1
votes

I'm making one of those endless runner mobile games where try to beat your highscore for iOS. I'm trying to display a banner ad at the bottom of the screen after each play using AdMob. I'm making the game in Adobe AIR so I'm using the AdMob native extension for iOS by Milkman Games. I have the extension setup and working but when I test my game, the ad loads once and then when I hide its visibility and try to make it visible again after another game, it never becomes visible. I have a function named isGameOver, which is called when the game is over, and in it I have this:

if (AdMob.isSupported)
        {
            AdMob.init("my ad unit id (it's actually here, just don't want to publicly share it)");

            //Remove this line when done testing!
            AdMob.enableTestDeviceIDs(AdMob.getCurrentTestDeviceIDs());

            AdMob.showAd(AdMobAdType.SMART_BANNER, AdMobAlignment.CENTER, AdMobAlignment.BOTTOM);

            AdMob.setVisibility(true);
        }

Then when the player taps the play again button, the function playButtonPressed is called and in it I have:

if (AdMob.isSupported)
        {
            AdMob.setVisibility(false);
        }

Any ideas?

1
try to initialize banner in constructor of your main class and just use visible (true/false)... tell me if it works. And second, try without test device...tziuka
Initializing it in my main class worked. Thank you :)Craig
could you accept the answer? plstziuka

1 Answers

1
votes

Initialize the banner in the constructor of your main class and just use visible (true/false)... If is not working, try without the test device...