-1

i want to implement real admob ads in my unity game, i have found banner ad code from google and i replaced test unit id with my real admob app unit id. now problem is that when banner ad show a test ad will be app appeared on to top side of banner ad pls help why show show test ad while i implement real add unitID here is banner ad code.

using System;
using UnityEngine;
using GoogleMobileAds.Api;
public class realsimpleAd : MonoBehaviour
{
    private BannerView bannerView;

    public void Start()
    {
        this.RequestBanner();
    }

    private void RequestBanner()
    {


        string adUnitId = "ca-app-pub-1154915214031679/1860375924";


        this.bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);

        // Called when an ad request has successfully loaded.
        this.bannerView.OnAdLoaded += this.HandleOnAdLoaded;
        // Called when an ad request failed to load.
       
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();

        // Load the banner with the request.
        this.bannerView.LoadAd(request);
    }
    public void HandleOnAdLoaded(object sender, EventArgs args)
    {
        MonoBehaviour.print("HandleAdLoaded event received");
    }  
}

enter image description here pls help me thanks in advance

iFralex
  • 591
  • 1
  • 2
  • 9
user6405383
  • 146
  • 1
  • 2
  • 13

1 Answers1

0

Admob will always show test ads in the Unity editor and in applications with few views and recently published. To experience real ads, you will need to post your app on a store and wait until it downloads enough to show the ads. As soon as it is published, no ads will appear, because it has not received enough views.

iFralex
  • 591
  • 1
  • 2
  • 9
  • game is playing in mobile, not in editor. while playing game in mobile test ad showing – user6405383 Jul 15 '22 at 21:19
  • Ah ok, but the answer is still valid. You need the game to be played by a lot of people for some time before Admob shows the ads. If you think my answer is the answer to your question, you can mark it as accepted :) – iFralex Jul 16 '22 at 04:11
  • not help full your ans. pls suggest another ans – user6405383 Jul 16 '22 at 06:44
  • Are you saying my answer is not helpful? It is the only possible one. There are no other ways to show ads ... Can you tell why it's not useful? – iFralex Jul 16 '22 at 06:51