Search Unity

Banner ads functionality

Discussion in 'Unity Ads' started by kavoogames, Sep 12, 2019.

  1. kavoogames

    kavoogames

    Joined:
    Sep 12, 2019
    Posts:
    2
    When I call a banner ad to be displayed on the screen, it fills the whole screen like a video ad. How would I go about making the ad appear as an actual banner on the top/bottom of the screen?
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,277
    @kavoogames

    Banner ads shouldn't be rendered full screen. Are you calling the Banner specific methods in the API:

    Code (CSharp):
    1. string placement = "banner";
    2. public void LoadBanner()
    3. {
    4.     if(!Advertisement.Banner.isLoaded)
    5.     {
    6.         BannerLoadOptions loadOptions = new BannerLoadOptions
    7.         {
    8.             loadCallback = OnBannerLoaded,
    9.             errorCallback = OnBannerError
    10.         };
    11.         Advertisement.Banner.Load(placement, loadOptions);
    12.     }
    13. }
    14. void OnBannerLoaded()
    15. {
    16.     Debug.Log("Banner Loaded");
    17.     Advertisement.Banner.Show(placement);
    18. }
    19. void OnBannerError(string error)
    20. {
    21.     Debug.Log("Banner Error: " + error);
    22. }
    23.  
    You will also have to make sure that the Placement ID you use is configured as a Banner in the dashboard.