Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Bug Unity Ads Banner Bug

Discussion in 'Unity Ads & User Acquisition' started by TraianDraghici, Sep 18, 2022.

  1. TraianDraghici

    TraianDraghici

    Joined:
    Jan 4, 2020
    Posts:
    66
    Hi,
    I recently updated to newest version of Unity (2022.1), newest Ads SDK.
    I have a problem with Banner Ads on Android.
    I set the position to be TOP Center but on the phone it appears Top Left.
    This is the code I use:
    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.Advertisements;
    4.  
    5. public class BannerAd : MonoBehaviour
    6. {
    7.  
    8.     public string gameId = "4666874";
    9.     public string surfacingId = "banner";
    10.     public bool testMode = false;
    11.  
    12.     void Start()
    13.     {
    14.             Advertisement.Initialize(gameId, testMode);
    15.             StartCoroutine(ShowBannerWhenInitialized());
    16.     }
    17.  
    18.     IEnumerator ShowBannerWhenInitialized()
    19.     {
    20.         while (!Advertisement.isInitialized)
    21.         {
    22.             yield return new WaitForSeconds(0.5f);
    23.         }
    24.         Advertisement.Banner.Show(surfacingId);
    25.         Advertisement.Banner.SetPosition(BannerPosition.TOP_CENTER);
    26.     }
    27. }
    I also tried to use top left position to see if it is inverted but it shows only top left.

    This is an old code.
    If I try and use the new code provided in the documentation banners does not appear.
    Please help :)
     
  2. TraianDraghici

    TraianDraghici

    Joined:
    Jan 4, 2020
    Posts:
    66
    Edit: The problem comes from Unity Ads SDK 4.3.0.
    I downgraded to Unity 2020 and SDK 4.2.1 and everything works fine again.
     
    moneysolutionsxyz likes this.
  3. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    I look forward to the day Unity hires their first tester.
     
  4. stekatsaros

    stekatsaros

    Joined:
    May 11, 2017
    Posts:
    6
    Is there any official update on this? This issue has been going on from the day the unity ads sdk 4.3.0 was released. Thanks :/
     
    moneysolutionsxyz likes this.
  5. moneysolutionsxyz

    moneysolutionsxyz

    Joined:
    Jul 17, 2022
    Posts:
    14
    I also have the same issue. but when i remove the latest version (4.3.0) and go back to default version (3.7.5), after that my ads didn't shows at all (at least they are showing in latest version ) :(
     
  6. TraianDraghici

    TraianDraghici

    Joined:
    Jan 4, 2020
    Posts:
    66
    Go back to version 4.2.1
     
  7. moneysolutionsxyz

    moneysolutionsxyz

    Joined:
    Jul 17, 2022
    Posts:
    14
    How???
     
  8. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    Edit the manifest.json file in your project Packages folder and change the version to 4.2.1
    "com.unity.ads": "4.2.1",

    You may need to restart Unity
     
  9. Unity_Adamski

    Unity_Adamski

    Unity Technologies

    Joined:
    Jul 20, 2020
    Posts:
    110
    Hi All, I can confirm that this is a known bug with the Unity package version of SDK 4.3.0.
    This should be fixed in version 4.4.0.