Unity Ads not working all of a sudden

Hi guys,

So I remember in the weekend my project’s ad function working and for some reason now I can’t seem to get it to work all of a sudden… I even tried nuking my project (archiving it), and re-adding it but still doesn’t work.

The current code I have is as per follows :

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

public class Button : MonoBehaviour {
   
    #if !UNITY_ADS
    private string gameId;
    public bool enableTestMode = true;
    #endif

    IEnumerator Start(){
        #if !UNITY_ADS // If the Ads service is not enabled...
        if (Advertisement.isSupported) { // If runtime platform is supported...
        Advertisement.Initialize(gameId, enableTestMode); // ...initialize.
        }
        #endif

        // Wait until Unity Ads is initialized,
        //  and the default ad placement is ready.
        while (!Advertisement.isInitialized || !Advertisement.IsReady()) {
            yield return new WaitForSeconds(0.5f);
        }

        // Show the default ad placement.
        Advertisement.Show();

    }

    public void changeScene (string str){
        Application.LoadLevel (str);
    }

}

This code bit used to work for me, but now it doesn’t. I’ve also tried initialising the Ad manuall like

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

public class Button : MonoBehaviour {
    
    IEnumerator Start(){
        Advertisement.Initialize("123456", true); // ...initialize.

        while (!Advertisement.isInitialized || !Advertisement.IsReady()) {
            yield return new WaitForSeconds(0.5f);
        }

        Advertisement.Show();

    }

    public void changeScene (string str){
        Application.LoadLevel (str);
    }

}

but same story, and also tried with the start function as a void and with the waitsec part gone although I really shouldn’t do that part.

The problem is that there are no errors or warning but just the Ad (the blue an ad should be here screen) never loads on the editor, nor on an adroid device.

I’m currently using unity 5.50f3, using the Unity Ad via services, not through assests, and my project is set so it’s an Android build.

There’s a known issue on Unity 5.5.0 that could be affecting your Ads integration:

Using the Asset Store package or adjusting the UnityConnectSettings.asset as instructed behind the above link should fix your issue: How to troubleshoot Unity 5.5 integrations - Unity Services - Unity Discussions

Apologies for any inconvenience.

1 Like

Thanks mikai,
This helped my out a lot. But at the same time I was wandering if the issue has/ or is schduled to be fixed anytime soon?
Since the integrated Ad function in the services is such a convenient feature.
I do use the unity ad from the Asset store now but time to time I get an error saying that I’ve defined “ShowResults” more than once and I think it’s to do with me fiddling around with the settings but not too sure…
Would help a lot to get the easy option back :wink: