Search Unity

About adding admob

Discussion in 'Getting Started' started by CaptainTR, Jan 7, 2019.

  1. CaptainTR

    CaptainTR

    Joined:
    Nov 11, 2015
    Posts:
    11
    I run ads with the given sample ad unit ID, but it doesn't work with the my ID

    The application was not added to Google Play

    what can I do for the solution

    I'm sorry for my bad english
     
    Last edited: Jan 7, 2019
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,426
    Please define "doesn't work", are you receiving a NoFill response? Please show your code and the device logs.
     
  3. CaptainTR

    CaptainTR

    Joined:
    Nov 11, 2015
    Posts:
    11
    I am not getting an error

    I use this way



    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.unity.ads"
    android:versionName="1.0"
    android:versionCode="1">
    <uses-sdk android:minSdkVersion="14"
    android:targetSdkVersion="19" />
    <application>
    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="*******" />
    </application>
    </manifest>



    using UnityEngine;
    using System.Collections;
    using GoogleMobileAds.Api;

    public class AddInst : MonoBehaviour {

    private InterstitialAd interstitial;

    private void Start()
    {
    string appId = "*******";

    MobileAds.Initialize(appId);

    interstitial = new InterstitialAd("*******");

    AdRequest request = new AdRequest.Builder().Build();

    interstitial.LoadAd(request);

    if (interstitial.IsLoaded())
    {
    interstitial.Show();
    }
    }
    }
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,426
    Please describe what is not working. How are you debugging? What is the return value of IsLoaded?
     
  5. CaptainTR

    CaptainTR

    Joined:
    Nov 11, 2015
    Posts:
    11
    I am not getting an error

    I run ads with the given sample addUnitID, but it doesn't work with the my ID

    I use genymotion emulator for testing

    add.png
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,426
    Again, what is the return code for IsLoaded? How are you debugging? You can debug live in Visual Studio, or simply place Debug.Log statements in your code which will also show in the logs.