Ads Not Showing On Enable

Hello
I am following a tutorial on youtube. In this tutorial there are two buttons to show ads on press. When I press the button … well AD is showing, but if for instance I call the method in the “OnEnable” or in Start… AD won’t show, despite LOG saying that method is called

 string GooglePlay_ID = "MyNumber";
    bool TestMode = false;

    private void Start()
    {
        Advertisement.Initialize(GooglePlay_ID, TestMode);
        ShowAD();
    }

    public void ShowAD()
    {
        Debug.Log("Show");
        Advertisement.Show();
    }

Could you please explain me why?

Thanks!

When you initialize the SDK, it needs time to contact our servers and cache media content before any ads can be shown. Since you’re trying to show an ad immediately, the problem is that the SDK isn’t ready yet :slight_smile:

You can check our knowledge base for a guide on how to make your code work:
https://unityads.unity3d.com/help/unity/integration-guide-unity