Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

I can see the test ads in the editor but I can't see them on the mobile

Discussion in 'Unity Ads & User Acquisition' started by dlolg, Oct 26, 2019.

  1. dlolg

    dlolg

    Joined:
    Sep 25, 2018
    Posts:
    13
    I can see the test ads in the editor but I can't see them on the mobile. I do not understand why. I have tried several things commented on the internet but none works for me.


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Monetization;
    5.  
    6.  
    7. public class VideoAd : MonoBehaviour
    8. {
    9.     private string gameId = "MY_GAME_ID for android";
    10.     private string bannerId = "video";
    11.     public bool testMode;
    12.  
    13.     void Start()
    14.     {
    15.  
    16.        
    17.         Monetization.Initialize(gameId, testMode);
    18.  
    19.         StartCoroutine(bannerIENUM());
    20.        
    21.     }
    22.     IEnumerator bannerIENUM()
    23.     {
    24.         yield return new WaitForSeconds(2);
    25.  
    26.         print("anunci1");
    27.         if (Monetization.IsReady(bannerId))
    28.         {
    29.             print("anunci2");
    30.             ShowAdPlacementContent ad = null;
    31.             ad = Monetization.GetPlacementContent(bannerId) as ShowAdPlacementContent;
    32.  
    33.             if (ad != null)
    34.             {
    35.                 ad.Show();
    36.                 print("anunci3");
    37.             }
    38.         }
    39.     }
    40.  
    41.  
    42.    
    43. }
    44.  
     
  2. Performator

    Performator

    Joined:
    Apr 30, 2018
    Posts:
    2
    I can be wrong about this, but isn't gameId supposed to be the numbers from your unity ads dashboard?
     
  3. rasmus-unity

    rasmus-unity

    Unity Technologies

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Looks like you are testing with Android. Easiest is if you can get the Android device log, using "adb logcat -v time UnityAds:V *:S" from command line, and see if it shows any errors.

    You are welcome to post here, if it's still unclear.

    /Rasmus
     
  4. dlolg

    dlolg

    Joined:
    Sep 25, 2018
    Posts:
    13

    If GAME_ID are numbers, I just put this so as not to put my GAMEID. I think I solved it, I put my cell phone as Test Devices and in the false bool test mode and I watch the videos but the banners don't, and I think it's pk. I use the ad version below 3.3 and in the EU banners are not allowed in previous versions.
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    I'm glad you were able to sort out your issue.

    Just a point of clarification, the Monetization API that you used in your original post does not support banners. You should use the Advertisements namespace for that:
    https://docs.unity3d.com/Packages/c...gine.Advertisements.Advertisement.Banner.html