I am using admob with unity. But the ads are not getting loaded. My script is bellow.. Am i missing something? Or i have to do something else?
float time;
private InterstitialAd interstitialAd;
// Use this for initialization
void Start () {
interstitialAd = new InterstitialAd("xxxxxx");
LoadAd();
time = Time.time + 30;
}
void LoadAd()
{
interstitialAd.LoadAd(new AdRequest.Builder().Build());
}
private void Update()
{
if(time<Time.time)
{
time += 20;
if (interstitialAd.IsLoaded()) {
ShowReward();
LoadAd();
}
else
{
MonoBehaviour.print("Not Loaded");
}
}
}
public void ShowReward()
{
interstitialAd.Show();
}
Comment
Your answer
Follow this Question
Related Questions
adMob ads are black 2 Answers
Unity Google AdMob Banner 2 Answers
How much money I can earn with Unity Ads? 1 Answer
Is ad platform CPIMobi good or bad? 5 Answers
How to create a remove ads in app purchase for unity android game? 1 Answer