Search Unity

Unity Ads stay at testMode

Discussion in 'Unity Ads & User Acquisition' started by unity_wOyzFyZnlBfbfA, Apr 14, 2021.

Thread Status:
Not open for further replies.
  1. unity_wOyzFyZnlBfbfA

    unity_wOyzFyZnlBfbfA

    Joined:
    May 17, 2020
    Posts:
    3
    I have a game I did not publish it yet because I want the ads to work first. The problem is that even if I set testMode to false in the Code and in the Services tab it still shows test ads or no ad at all i tried it on 2 phones one android one iOS.
    I want the ad to show up every time you click play in the Start menu
    I created a empty object with the script.
    here's the code:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Advertisements;
    5. using UnityEngine.SceneManagement;
    6.  
    7. public class Ads : MonoBehaviour
    8. {
    9.     string gameId = "4078981";
    10.     bool testMode = true;
    11.  
    12.     void Start()
    13.     {
    14.         Advertisement.Initialize(gameId, testMode);
    15.     }
    16.  
    17.     public void VideoAd ()
    18.     {
    19.         Advertisement.Show();
    20.         SceneManager.LoadScene(1);
    21.     }
    22. }
    23.  
     
  2. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Your testMode variable in that script is true, so make sure that is false first of all. Second of all, if no ads are showing then it's likely that the initialization either failed or there was a problem loading ads -- or possibly that you tried to show the ad before the SDK was ready.

    Either way, if you're able to get a device log from when you run your app, there should be an error message or some other clue as to what is happening.
     
    djhatvr likes this.
  3. unity_wOyzFyZnlBfbfA

    unity_wOyzFyZnlBfbfA

    Joined:
    May 17, 2020
    Posts:
    3
    Thanks for the reply. How do i check if the sdk is ready or not and how do i get a device log
    Thanks in advance
     
  4. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
Thread Status:
Not open for further replies.