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. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Official AdMob plugin not showing any ads - followed all kinds of tutorials.

Discussion in 'Editor & General Support' started by Vect0rZ, Nov 5, 2014.

  1. Vect0rZ

    Vect0rZ

    Joined:
    Nov 5, 2014
    Posts:
    2
    Hey guys.

    I recently installed Google Play Services and downloaded the official Google AdMob plugin from here:

    https://github.com/googleads/googleads-mobile-plugins/releases

    Installed it as new custom asset, and copied the services folder in my App/Plugins/Android folder.

    [This is the current configuration, before that I tried following a YouTube video where i compiled some jar with Eclipse - didn't work]

    Here is the code I use:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using GoogleMobileAds.Api;
    4.  
    5. public class mainMenuCamera : MonoBehaviour {
    6.  
    7.     // Use this for initialization
    8.     void Awake()
    9.     {
    10.         RequestBanner ();
    11.     }
    12.     void Start () {
    13.  
    14.     }
    15.  
    16.     // Update is called once per frame
    17.     void Update () {
    18.  
    19.     }
    20.  
    21.     private void RequestBanner()
    22.     {
    23.         #if UNITY_EDITOR
    24.         string adUnitId = "unused";
    25.         #elif UNITY_ANDROID
    26.         string adUnitId = " ";
    27.         #else
    28.         string adUnitId = "unexpected_platform";
    29.         #endif
    30.  
    31.         BannerView bannerView = new BannerView (adUnitId, AdSize.Banner, AdPosition.Top);
    32.         AdRequest request = new AdRequest.Builder ()
    33.             .AddTestDevice (AdRequest.TestDeviceSimulator)
    34.                 .AddTestDevice ("2077ef9a63d2b398840261c8221a0c9b")
    35.                 .Build ();
    36.         bannerView.LoadAd (request);
    37.     }
    38. }
    Nothing shows up again...

    Thanks in advance.
     
    hardc0re likes this.
  2. nonabonasonadona

    nonabonasonadona

    Joined:
    Dec 8, 2014
    Posts:
    17
    I'am having the same problem, were you able to fix it?
     
    hardc0re likes this.