Search Unity

Unity Ads Never Initialises in Editor

Discussion in 'Unity Ads & User Acquisition' started by matbrummitt, Aug 23, 2015.

  1. matbrummitt

    matbrummitt

    Joined:
    Jan 12, 2010
    Posts:
    107
    Hi all,

    I just attempted to integrate Unity Ads into my game, and found it refreshingly simple reading over the docs. However, in practice it doesn't seem to work for me.

    I have imported the Unity Ads package, added a game to my account, grabbed the ID and run the Initialise code:

    Code (CSharp):
    1. if (Advertisement.isSupported)
    2.     Advertisement.Initialize ("65149", false);
    You'll note that i've tried forcing test mode to false here.

    In an Update function, I am testing with the following:

    Code (CSharp):
    1.     private void ShowAdOnPressSpace () {
    2.         if (Input.GetKeyUp(KeyCode.Space)) {
    3.  
    4.             if (Advertisement.isInitialized)
    5.                 Debug.Log("Unity Ads Initialized succesfully");
    6.             else
    7.                 Debug.Log("Unity Ads Not Initialized");
    8.  
    9.             if (Advertisement.IsReady())
    10.                 Advertisement.Show();
    11.             else
    12.                 Debug.Log ("Advertisement not ready");
    13.         }
    14.     }
    When I press space, the log says "Unity Ads Not Initialized" every time.

    One thing to note is that I don't have my App store ID yet, so in my account the game was created by simply specifying the name.

    Searching google, I didn't find anyone having similar issues.

    Thanks

    Mat
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Hi Mat,

    Have you changed target build (in Build Settings window) to be either iOS or Android?

    /Rasmus
     
  3. matbrummitt

    matbrummitt

    Joined:
    Jan 12, 2010
    Posts:
    107
    Hi Rasmus,

    I haven't I was just following the getting started guide and I don't think it mentioned that. I'll give that a try now.

    I also just saw that a sticky on the forum is about also importing a helper package? Is this required? again, this wasn't mentioned in the docs (not that I saw anyway).

    Thanks

    Mat
     
  4. matbrummitt

    matbrummitt

    Joined:
    Jan 12, 2010
    Posts:
    107
    Hi Rasmus,

    That worked a charm, thank you!

    Does this mean however, that the web player is not supported? My app/game is ideal for multi-platform targeting and I was planning on releasing for desktops and web player as well as mobile.

    Thanks again

    Mat
     
  5. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312