hi guys,
really need your help.
Just added AdMob to my project.
I try to make my test ads to show but they aren’t showing after i build and run my game to my phone.
in the in the console said the following lines after I press button to show the banner view:
dummy .octr
dummy CeateBannerView
dmmy LoadAD
dummy ShowBannnerView
Please note that I’m using sample AppID and sample banner and sample interstitial !
this is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
public class Admanager : MonoBehaviour
{
public static Admanager instance;
private string appID = "ca-app-pub-3940256099942544~3347511713";
private BannerView bannerView;
private string bannerID = "ca-app-pub-3940256099942544/6300978111";
private InterstitialAd fullScreenAd;
private string fullScreenAdID = "ca-app-pub-3940256099942544/1033173712";
private void Awake()
{
if(instance == null)
{
instance = this;
}
else
{
Destroy(this);
}
}
private void Start()
{
MobileAds.Initialize(appID);
//requestFullScreenAd();
//requestBanner();
//showFullScreenAD();
}
public void requestBanner()
{
bannerView = new BannerView(bannerID, AdSize.Banner, AdPosition.Bottom);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);
bannerView.Show();
}
public void hideBanner()
{
bannerView.Hide();
}
public void requestFullScreenAd()
{
fullScreenAd = new InterstitialAd(fullScreenAdID);
AdRequest request = new AdRequest.Builder().Build();
fullScreenAd.LoadAd(request);
}
public void showFullScreenAD()
{
if (fullScreenAd.IsLoaded())
{
fullScreenAd.Show();
}
else
{
Debug.Log("full Screen Ad is not loaded loaded");
}
}
}
i call requsetBanner from a button:
public void OnClickBanner()
{
Admanager.instance.requestBanner();
}
my manifest: