Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

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:
    3,130
    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:
    3,130
    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:
    3,130
    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.