Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

Banner Admod not always showing!

$
0
0
Hy im kinda wth a strange problem, I have this game for mobile (in testing on android) and it is not always showing my banner, sometimes it does show and sometimes not (on the same biuld that I have on my phone). Here is the code, if somebody could help me! using System.Collections; using System.Collections.Generic; using UnityEngine; using GoogleMobileAds.Api; public class Ad_Mob_Script2 : MonoBehaviour { private BannerView bannerView; [SerializeField] private string appID = "ca-app-pub-1188220283344166~4305226342"; [SerializeField] private string bannerID = "ca-app-pub-1188220283344166/3159240602"; [SerializeField] private string regularAD = "ca-app-pub-1188220283344166/5726119223"; void Start() { this.RequestBanner(); } private void Awake() { MobileAds.Initialize(appID); } public void OnClickShowBanner() { this.RequestBanner(); } public void OnClickShowAd() { RequestRegularAD(); } private void RequestRegularAD() { InterstitialAd AD = new InterstitialAd(regularAD); AdRequest request = new AdRequest.Builder().Build(); AD.LoadAd(request); AD.Show(); } private void RequestBanner() { bannerView = new BannerView(bannerID, AdSize.Banner, AdPosition.Top); AdRequest request = new AdRequest.Builder().Build(); bannerView.OnAdFailedToLoad += HandleOnAdFailedToLoad; bannerView.LoadAd(request); bannerView.Show(); } public void HandleOnAdFailedToLoad(object sender, AdFailedToLoadEventArgs args) { this.RequestBanner(); } }

Viewing all articles
Browse latest Browse all 1416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>