- Home /
admob Ads doesn't show when im using the real Ad Id, but if Im using test ad id it show up
hello guys, i have been developed my first game and i want to add ads in it and here is the code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
public class bannerads : MonoBehaviour {
BannerView bannerView;
public GameObject shopscreen;
void Start () {
// Create an empty ad request.
AdRequest request = new AdRequest.Builder()
.AddTestDevice(AdRequest.TestDeviceSimulator) // Simulator
.AddTestDevice("xxxx46bda46fa8b9xxxxxxxxxx") // My test device.
.Build();
// Load the banner with the request.
// Create a 320x50 banner at the top of the screen.
bannerView = new BannerView("ca-app-pub-xxxxxxxxxxxxx/xxxxxxxx", AdSize.SmartBanner, AdPosition.Bottom);
bannerView.LoadAd(request);
}
void Update()
{
if (shopscreen.activeInHierarchy == true)
{
bannerView.Show ();
Debug.Log("SHOW AD banner");
}
else if(shopscreen.activeInHierarchy == false)
{
bannerView.Hide();
}
}
}
when I testing it with test Ad id, the ads show up in my game when I build and run it in android. but when I using my Admob real Ad Id, nothing show up
when I looking in the internet for the solution, many said I must wait some hour before the ads sho up but its already 1 day and my live ads still doesn't show up
help me guys
note: im already change my testdevice id code with my android device id too
sry for bad english
Comment
Answer by Arede · Jul 11, 2017 at 10:18 AM
Sorry Guys, My bad I just found the solution, and its becaus the TestDevice ID, its case sensitive and all of my device id use uppercase im very newbie in this, forgive my dumb question