In editor appear an image when I call UnityAds, but on android device..nothing happens :((

Hi,

I recently publish a beta version of my game to test google services and ads before to publish my final app. It’s my first game.

The google services it’s ok. -
But I have some problems with Unity Ads. ://

On Editor:
Appear an image with one message. (Here would be your ad Unit (things seems to be working!))
“Yaha! It’s working” I thought.
On Android device:
…nothing…
“No…No no…nOOOOu” I thought crying kkkk

My code:

using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;

public class <AdScript> : MonoBehaviour {

    [SerializeField] string gameID = "GameID";

    void Awake () {
        Advertisement.Initialize (gameID, true);
    }

    public void ShowAd(string zone = ""){
        #if UNITY_EDITOR
            StartCoroutine (WaitForAd ());
        #endif

        if(string.Equals (zone, ""))
            zone = null;

        ShowOptions options = new ShowOptions ();
        options.resultCallback = AdCallbackhandler;

        if (Advertisement.IsReady(zone))
            Advertisement.Show (zone, options);
    }

    void AdCallbackhandler(ShowResult showResult){
        switch (showResult) {
            case ShowResult.Finished:
            Debug.Log ("Ad finished...Take your reward!");
            break;
            case ShowResult.Skipped:
            Debug.Log ("Oh no...:/");
            break;
            case ShowResult.Failed:
            Debug.Log ("Sorry. Don't happen again.");
            break;
        }
    }

    IEnumerator WaitForAd(){
        float currentTimeScale = Time.timeScale;
        Time.timeScale = 0f;
        yield return null;

        while(Advertisement.isShowing)
            yield return null;

        Time.timeScale = currentTimeScale;
    }
}

Help me?

Hi, sorry for late reply.

You shouldn’t have to set Time.timeScale = 0, as game is automatically paused by Unity Ads when showing video ad. Please see https://unityads.unity3d.com/help/Documentation%20for%20Publishers/Integration-Guide-for-Unity-Asset-Store for instruction on how to integrate Ads into your Unity game. Generally I think you should remove the coroutine call, as Unity Ads will pause the game itself.

Hope this helps.

/Rasmus