Admob TestAds dont’t show up on device

2 min


0

Admob’s Test adverts wont show on any of my take a look at Devices however log that they’re loaded within the Unity Editor.

I’ve resolved the android dependencies and I’ll show my Manifest and AddCaller and I’ve the Google Repository and The play providers SDK I do not get any errors it simply wont show the take a look at adverts!

Android MANIFEST:

<?xml model="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged along with your
software's manifest, including the required exercise and permissions
required for displaying adverts. android:minSdkVersion="14"
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    bundle="com.google.unity.ads"
    android:versionName="1.0"
    android:versionCode="1">

  <!-- Required -->
  <uses-permission android:identify="android.permission.INTERNET"/>

  <uses-sdk android:targetSdkVersion="19" />
  <software>
  <!-- Your AdMob App ID will look much like this pattern ID:
    ca-app-pub-3940256099942544~3347511713 -->
    <meta-data
    android:identify="com.google.android.gms.ads.APPLICATION_ID"
    android:worth="ca-app-pub-xxxxxxxxxx~xxxxxxx"/>
  </software>
</manifest>

AdScript:

utilizing System.Collections;
utilizing System;
utilizing System.Collections.Generic;
utilizing UnityEngine;
utilizing GoogleMobileAds.Api;

public class AddScript : MonoBehaviour
{
    non-public string AppID = "ca-app-pub-xxxxxxxx~xxxxxxxx";

    non-public BannerView bannerAD;
    public InterstitialAdvert interAD;

    public int addTick;

    // Start known as earlier than the primary body replace
    void Start()
    {
        string appId = AppID;

        //Initialize Ads SDK
        MobileAds.Initialize(appId);
        RequestInterstitial();
        RequestBanner();
    }

    non-public void OnLevelWasLoaded(int degree)
    {
        if (degree == 2)
        {
            ShowInterstitial();
        }

        if(degree == 1)
       {
            bannerAD.Show();
       }
    }

    non-public void RequestInterstitial()
    {
#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-3940256099942544/1033173712";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-3940256099942544/4411468910";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Initialize an InterstitialAdvert.
        this.interAD = new InterstitialAdvert(adUnitId);
        // Create an empty advert request.
        AdRequest request = new AdRequest.Builder().AddTestDevice("xxxxxxxxxxxx").Build();

        // Called when an advert request has efficiently loaded.
        interAD.OnAdLoaded += HandleOnAdLoaded;
        // Called when an advert request did not load.
        interAD.OnAdFailedToLoad += HandleOnAdFailedToLoad;

        // Load the interstitial with the request.
        this.interAD.LoadAdvert(request);
    }

    non-public void ShowInterstitial()
    {
        if (this.interAD.IsLoaded())
        {
            this.interAD.Show();
        }
        else
        {
            MonoBehaviour.print("Interstitial is not ready yet");
        }
    }


    non-public void RequestBanner()
    {
        string adUnitId = "ca-app-pub-3940256099942544/6300978111";

        // Create a 320x50 banner on the high of the display.
        bannerAD = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);

        // Create an empty advert request.
        AdRequest request = new AdRequest.Builder().AddTestDevice("xxxxxxxxxxx").Build();

        // Load the banner with the request.
        bannerAD.LoadAdvert(request);

    }

    public void HandleOnAdLoaded(object sender, EventArgs args)
    {
        MonoBehaviour.print("HandleAdLoaded event received");
    }

    public void HandleOnAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
    {
        MonoBehaviour.print("HandleFailedToReceiveAd event received with message: " + args.Message);
    RequestInterstitial();
    }
}

I anticipate a take a look at banner to show and an take a look at interstitial however nothing occurs.

and there’s no error or warning within the console it says the dummy loaded and displayed accurately.


What's Your Reaction?

hate hate
0
hate
confused confused
0
confused
fail fail
0
fail
fun fun
0
fun
geeky geeky
0
geeky
love love
0
love
lol lol
0
lol
omg omg
0
omg
win win
0
win

0 Comments

Your email address will not be published. Required fields are marked *

Choose A Format
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Poll
Voting to make decisions or determine opinions
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Meme
Upload your own images to make custom memes
Video
Youtube, Vimeo or Vine Embeds
Audio
Soundcloud or Mixcloud Embeds
Image
Photo or GIF
Gif
GIF format