googleads-mobile-plugins v2.1 RequestBanner Freezes my UI

119 views
Skip to first unread message

Xavier Descours

unread,
May 15, 2014, 4:19:39 AM5/15/14
to google-adm...@googlegroups.com
Hi,

I just implemented the googleads-mobile-plugins v2.1 for UNITY 4.3 for IOS and ANDROID.

My game is in portrait mode.
And I want to have the AdMob banner at the bottom of the screen.

I use this script :

void OnGUI()
    {
        // Puts some basic buttons onto the screen.
        GUI.skin.button.fontSize = (int) (0.02f * Screen.height);      
        Rect requestBannerRect = new Rect(0.3f * Screen.width, 0.05f * Screen.height,
                                          0.4f * Screen.width, 0.1f * Screen.height);
        if (GUI.Button(requestBannerRect, "Request Banner"))
        {
            RequestBanner();
        }
    }



private void RequestBanner()
    {

        #if UNITY_EDITOR
        string adUnitId = "unused";
        #elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-xxxxxxxxxxxxx/xxxxxxxxx";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-
xxxxxxxxxxxxx/xxxxxxxxx";
        #else
        string adUnitId = "unexpected_platform";
        #endif
        
        
        // Create a 320x50 banner at the top of the screen.
        BannerView bannerView = new BannerView(
            adUnitId, AdSize.Banner, AdPosition.Bottom);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().AddExtra("color_bg", "000000").Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);


    }



I have one left and one right button to the top of the screen.





But when I click on my GUI.Button to request the banner, my TOP buttons do not respond! It's like a mask on their or something like this.
But when the ad is loaded, my button respond.

I think when I do a request, the "invisible ad" is on the top until the ad is loaded to go to the bottom.
Have you any idea to help me? I get lots of headache with this "issue"!

Thanks in advance for your answers and sorry for my poor english, it's not my native language.



Eric Leichtenschlag

unread,
May 16, 2014, 8:25:01 PM5/16/14
to google-adm...@googlegroups.com
It turns out the plugin always set the banner to be at the top and then changed the position once the ad was received. I pushed a fix for this here. Please do a git pull to grab the update (I didn't make a new release).

Xavier Descours

unread,
May 18, 2014, 8:39:17 AM5/18/14
to google-adm...@googlegroups.com
Hi Eric,

Thanks for your fix! I 'll try it immediately!
 

Xavier Descours

unread,
May 18, 2014, 8:48:10 AM5/18/14
to google-adm...@googlegroups.com
It works great! thanks Eric!
Reply all
Reply to author
Forward
0 new messages