unity ads 2.0 not start on first scene load

unity ads not load on first scene, if i load second scene and back to first scene will show ads

  • on old version plugin ads 1.5 the ads will show on first scene after few seconds, please help
using UnityEngine;
#if UNITY_ANDROID
    using UnityEngine.Advertisements;
#endif

public class UnityAdsInitializer : MonoBehaviour
{
    [SerializeField]
    private string
    androidGameId = "1443906",
    iosGameId = "1443906";

    [SerializeField]
    private bool testMode;
    bool off_Ads = false;
    string gameId;
    void Start ()
    {
        gameId = null;

        #if UNITY_ANDROID
            gameId = androidGameId;
        Advertisement.Initialize(androidGameId,testMode);
        #elif UNITY_IOS
            gameId = iosGameId;
        #endif

        //if (Advertisement.isSupported && !Advertisement.isInitialized) {
        //    Advertisement.Initialize(gameId, testMode);
        //
        InvokeRepeating("Init_Ads",0f,6f);
        Invoke ("ShowAds", 5f);
        Showads ();
    }

    void Init_Ads()
    {
        #if UNITY_ANDROID || UNITY_IOS
            Advertisement.Initialize(gameId, testMode);
            //print ("Ads Shown");
        #endif
    }

    void Showads()
    {
        #if UNITY_ANDROID || UNITY_IOS
            Advertisement.Show ();
            //print ("Ads Shown
        #endif
    }
      
}

Why initialize multiple times, i.e. call to
InvokeRepeating("Init_Ads",0f,6f);?

SDK 2.0 does make an extra request to server, so might be in your case that it doesn’t finish within 5 seconds, before you call “ShowAds” method? (Although usually it should be ready before 5 seconds)

/Rasmus

please edit my script and send me back, im not programmer , y pay someone to made this

Did you pay someone for this code? In any case, you can see our integration guide at Unity developer integration guides, hope it gives you an idea on how to implement ads in your game.

Best regards,
Rasmus