Search Unity

AdMob banner statistic works, but cant see banner

Discussion in 'Editor & General Support' started by ituraspe, Apr 3, 2019.

  1. ituraspe

    ituraspe

    Joined:
    Jan 1, 2019
    Posts:
    27
    Hi, I have banner and I configure device as a test device. I dont know why, But I see my statistic in AdMob "
    Requests 14" even though it's a test device. But I cant see banner in game.
    Nothing is displayed. Here is my code.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using GoogleMobileAds.Api;
    5.  
    6. public class GoogleOglasi : MonoBehaviour
    7. {
    8.     private BannerView bannerView;
    9.  
    10.     public void Start()
    11.     {
    12.         this.RequestBanner();
    13.     }
    14.  
    15.     private void RequestBanner()
    16.     {
    17.         #if UNITY_ANDROID
    18.             string adUnitId = "ca-app-pub-1583xxxxxxxxxxxxxxxxxxxxxxx";
    19.         #elif UNITY_IPHONE
    20.             string adUnitId = "ca-app-pub-3940256099942544/2934735716";
    21.         #else
    22.             string adUnitId = "unexpected_platform";
    23.         #endif
    24.  
    25.         // Create a 320x50 banner at the top of the screen.
    26.         bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);
    27.  
    28.         AdRequest request = new AdRequest.Builder()
    29.   .AddTestDevice("xxxxxxx(hidden for privacy)xxxxxxxxxxxxxx")
    30.   .Build();
    31.  
    32.         bannerView.LoadAd(request);
    33.     }
    34. }
    35.