Hello. I made a game with unity for android and I’m having problems wirh admob.When I first set the AdMob It was working fine.But now, it’s not showing banner and when I request interstitial, the app directly closes.
When I run the code in Unity, it works fine. I can see the following in the console:
Created DummyClient
Dummy CreateBannerView
Dummy LoadAd
When I compile the code for android, I can’t get past the initializing.
MobileAds.Initialize(initStatus => { });
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
using UnityEngine.UI;
public class reklamlar : MonoBehaviour
{
private BannerView bannerView;
string adUnitId = "ca-app-pub-3940256099942544/6300978111";
void Start()
{
MobileAds.Initialize(initStatus => { });
this.RequestBanner();
ShowBannerAd();
}
public void RequestBanner()
{
this.bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
Debug.Log("banner Request");
}
public void ShowBannerAd()
{
AdRequest request = new AdRequest.Builder().Build();
this.bannerView.LoadAd(request);
Debug.Log("banner Show");
}
// Update is called once per frame
void Update()
{
}
}