Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Solved] How to guide on UnityAds 3.0 SDK Banners for Unity 2018.3 Please...

Discussion in 'Unity Ads & User Acquisition' started by RaulDoesNothing, Dec 28, 2018.

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

    RaulDoesNothing

    Joined:
    Oct 28, 2018
    Posts:
    5
    Ok so now I'm super lost. I am new to understanding how Ads work and I've wanted a simple way, so I entrusted to use the UnityAds 3.0 SDK. But let's begin at the start. I updated to the new Unity 2018.3 and most of my project did not work because over 70% of it was in UnityScript so I just made my whole app from scratch, the issue now is I do not remember how I made apps work last time. So what's going on now is that I no clue how to setup UnityAds 3.0 since there is a bug for some reason which was stated on the forums but I do not know how to fix this issue or if it's my code that does not work, which is straight from the website:
    https://unityads.unity3d.com/help/unity/integration-guide-unity#implementing-banner-ads

    I am simply trying to make a banner Ad and that is all. Not that hard, can someone make an updated tutorial from the start or correct the code I used which is on the original documentation...


    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.Advertisements;
    4.  
    5. public class BannerAds : MonoBehaviour {
    6.  
    7.     public string bannerPlacement = "banner";
    8.     public bool testMode = false;
    9.  
    10. #if UNITY_IOS
    11.     public const string gameID = "MyGameID";
    12. #elif UNITY_ANDROID
    13.     public const string gameID = "MyGameID";
    14. #elif UNITY_EDITOR
    15.     public const string gameID = "1111111";
    16. #endif
    17.  
    18.     void Start () {
    19.         Advertisement.Initialize (gameID, testMode);
    20.         StartCoroutine (ShowBannerWhenReady ());
    21.     }
    22.  
    23.     IEnumerator ShowBannerWhenReady () {
    24.         while (!Advertisement.IsReady ("banner")) {
    25.             yield return new WaitForSeconds (0.5f);
    26.         }
    27.         Advertisement.Banner.Show (bannerPlacement);
    28.     }
    29. }
    30.  
    I can send further screenshots of anything if needed, Please someone assist me, I just want to release my first app already...
     
  2. Chella_GamzInn

    Chella_GamzInn

    Joined:
    Mar 12, 2018
    Posts:
    4
    Upgrading a project to 2018.3 needs few more steps for Unity Ads.



    Try changing the testmode to true as mentioned here and cross check your placements in the Dashboard
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I trust that those are not your REAL gameID's that you show in the code?
     
  4. RaulDoesNothing

    RaulDoesNothing

    Joined:
    Oct 28, 2018
    Posts:
    5
    Lol no of course not. I just didn't want to share them here
     
  5. RaulDoesNothing

    RaulDoesNothing

    Joined:
    Oct 28, 2018
    Posts:
    5
    Thank you responding so soon. So at this moment I am doing the force test mode of which I forgot I must do, which worked last time on my older version, and I am hoping it will work. I wanted to ask what do you mean by cross checking? and secondly, the new steps needed are confusing to understand, i try deleting the json file as mentioned but unity just brings it back as if it were never deleted.
     
  6. RaulDoesNothing

    RaulDoesNothing

    Joined:
    Oct 28, 2018
    Posts:
    5
    Ok so I was finally able to resolve my issue. It was just to follow the instructions given here:

    https://forum.unity.com/threads/upgrading-to-2018-3-with-unity-ads-sdk.601132/

    The issue in the reading is the removal of items in the json file. So simply you only need to delete

    "com.unity.ads": "2.3.1",

    and

    "com.unity.package-manager-ui": "2.0.3",

    I do not know if I deleted more than needed but It solved my issue and now I can see the Test Ads Banner at the bottom. Thank you Chella for your help!
     
Thread Status:
Not open for further replies.