- Home /
Question by
LukeDraper · Mar 14, 2019 at 05:29 PM ·
androidunity 5mobileadmob
problems with implementing Admob banner ads
Hi.
I followed this tutorial code. it says that there's supposed to be a little pop up where the banner is programmed to be, but its not popping up after I build and run it on android devices. When I run it I get a notification on the log of:
Dummy .ctor Dummy Createbannerview Dummy LoadAd
Any and all help would be appreciated.
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-***********";
//***For Testing in the Device***
AdRequest request = new AdRequest.Builder()
.AddTestDevice(AdRequest.TestDeviceSimulator) // Simulator.
.AddTestDevice("***********") // 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