Search Unity

How to hide and show unity banner ads

Discussion in 'Unity Ads & User Acquisition' started by SilverTerrier, Feb 5, 2019.

Thread Status:
Not open for further replies.
  1. SilverTerrier

    SilverTerrier

    Joined:
    Mar 31, 2018
    Posts:
    1
    Hello, I am using unity monetization 3.0 in my game and I only want to show banner ads on the main menu.
    But when a banner is hidden with Advertisment.banner.hide() it can't be shown again with Advertisment.banner.show

    If anyone has a fix to this that would be great, thanks.
     
  2. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    I have the same problem exactly.Rewarded video placement works perfectly but banner ads Impressions don't count even it shows.I have disabled ads in unity services but installed monetization.And i'm building app in android studio because of unity editor key signing error.

    Does it need to be initialized only one time?
     
    Last edited: Feb 5, 2019
  3. itayganor

    itayganor

    Joined:
    Sep 24, 2018
    Posts:
    14
  4. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    itayganor likes this.
  5. RabihDev

    RabihDev

    Joined:
    Sep 24, 2020
    Posts:
    2
    hey mate its easy just use a public boolean that is equal false and then enable it in the scenes that u want it to work in and to disable it put the boolean false and make shoor that in ur script u have Advertisment.banner.hide() in else. ex:
    public void Update()
    {
    if (ItsOn == true)
    {
    Advertisement.Banner.Show(BannerAd);
    }
    else
    {
    Advertisement.Banner.Hide();
    }
    }
     
  6. Kheremos

    Kheremos

    Joined:
    Dec 13, 2017
    Posts:
    17
    If you have a banner script attached in the scene where you want to show it, you can add this to the script:
    Code (CSharp):
    1. private void OnDestroy()
    2.     {
    3.         Advertisement.Banner.Hide();
    4.     }
    And if the same banner script does the start()->ShowBannerWhenReady() coroutine, it will reappear in that specific scene. Posting for those who come here from Google, like me. Adding a check like this in Update seems like a bad idea, because it will constantly be checking, every frame, forever...
     
    hritankardas12 and driuki like this.
Thread Status:
Not open for further replies.