Admob banner not showing
I have created an empty on my main menu scene and have attached this code to it. However it is not showing up when i test the game on my phone. Any help would be great. Thanks
using GoogleMobileAds.Api;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AdScript : MonoBehaviour
{
// Use this for initialization
void Start()
{
showBannerAd();
}
private void showBannerAd()
{
string adID = "ca-app-pub-3940256099942544/6300978111";
/*
//***For Testing in the Device***
AdRequest request = new AdRequest.Builder()
.AddTestDevice(AdRequest.TestDeviceSimulator) // Simulator.
.AddTestDevice("2077ef9a63d2b398840261c8221a0c9b") // My test device.
.Build();
*/
//***For Production When Submit App***
AdRequest request = new AdRequest.Builder().Build();
BannerView bannerAd = new BannerView(adID, AdSize.SmartBanner, AdPosition.Bottom);
bannerAd.LoadAd(request);
}
// Update is called once per frame
void Update()
{
}
}
Comment
Your answer
Follow this Question
Related Questions
Unity Google Mobile Ads (AdMob) not showing after building app for android 0 Answers
Interstitial ads and Rewarded ads not showing but Banners show after Android Build (Google Ad Mobs) 0 Answers
I would like to move the banner ad location of Unity AdMob to the location I want. 0 Answers
AdMob banner ad not showing! 1 Answer