- Home /
how to implement admob into your game and why doesnt this script work
Hello, my app TileTap ( on google play ) has advertisements in it , but they never display however in the console they work when intended to saying load interstitial ad..
what do i need to add for this to work in the build.
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using GoogleMobileAds.Api;
 
 public class AdmobManager : MonoBehaviour
 {
     private BannerView bannerView;
 
     [SerializeField] private string appID = "";
     [SerializeField] private string bannerID = "";
     [SerializeField] private string regularAD = "£;
     [SerializeField, Range(1, 900)] private int delayBetweenAds = 240;
     private static float lastAdTime = Mathf.NegativeInfinity;
 
     private void Awake()
     {
         MobileAds.Initialize(appID);
     }
 
     public void OnclickShowBanner()
     {
         this.RequestBanner();
     }
 
     public void OnClickShowAd()
     {
         if ((Time.time - lastAdTime) > (float)delayBetweenAds)
             this.RequestRegularAd();
     }
 
     private void RequestRegularAd()
     {
         InterstitialAd AD = new InterstitialAd(regularAD);
 
         AdRequest request = new AdRequest.Builder().Build();
 
         AD.LoadAd(request);
         lastAdTime = Time.time;
     }
 
     private void RequestBanner()
     {
         bannerView = new BannerView(bannerID, AdSize.Banner, AdPosition.Bottom);
 
         AdRequest request = new AdRequest.Builder().Build();
 
         bannerView.LoadAd(request);
     }
 }
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
Admob ads don't work 0 Answers
How do I enable AdMob to respond to inputs? 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                