public static void RequestInterstitial()
    {
                #if UNITY_EDITOR
        string adUnitId = "ca-app-pub-3940256099942544/1033173712";
                #elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-3940256099942544/1033173712";
                #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
                #else
        string adUnitId = "unexpected_platform";
                #endif

        // Create an interstitial.
        interstitial = new InterstitialAd(adUnitId);
        // Register for ad events.
        interstitial.AdLoaded          += HandleInterstitialLoaded;
        interstitial.AdFailedToLoad    += HandleInterstitialFailedToLoad;
        interstitial.AdOpened          += HandleInterstitialOpened;
        interstitial.AdClosing         += HandleInterstitialClosing;
        interstitial.AdClosed          += HandleInterstitialClosed;
        interstitial.AdLeftApplication += HandleInterstitialLeftApplication;
        GoogleMobileAdsDemoHandler handler = new GoogleMobileAdsDemoHandler();
        interstitial.SetInAppPurchaseHandler(handler);
        // Load an interstitial ad.
        interstitial.LoadAd(createAdRequest());
    }
Esempio n. 2
0
    public void RequestInterstitial()
    {
        #if UNITY_EDITOR
        string adUnitId = "unused";
        #elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-6631760566665115/4703961388";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-6631760566665115/1610894187";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create an interstitial.
        interstitial = new InterstitialAd(adUnitId);
        // Register for ad events.
        interstitial.AdLoaded          += HandleInterstitialLoaded;
        interstitial.AdFailedToLoad    += HandleInterstitialFailedToLoad;
        interstitial.AdOpened          += HandleInterstitialOpened;
        interstitial.AdClosing         += HandleInterstitialClosing;
        interstitial.AdClosed          += HandleInterstitialClosed;
        interstitial.AdLeftApplication += HandleInterstitialLeftApplication;
        GoogleMobileAdsDemoHandler handler = new GoogleMobileAdsDemoHandler();
        interstitial.SetInAppPurchaseHandler(handler);
        // Load an interstitial ad.
        interstitial.LoadAd(createAdRequest());
    }
    void UnregisterDelegateForInterstitial()
    {
        interstitial.AdLoaded          -= HandleInterstitialLoaded;
        interstitial.AdFailedToLoad    -= HandleInterstitialFailedToLoad;
        interstitial.AdOpened          -= HandleInterstitialOpened;
        interstitial.AdClosing         -= HandleInterstitialClosing;
        interstitial.AdClosed          -= HandleInterstitialClosed;
        interstitial.AdLeftApplication -= HandleInterstitialLeftApplication;
        GoogleMobileAdsDemoHandler handler = new GoogleMobileAdsDemoHandler();

        interstitial.SetInAppPurchaseHandler(handler);
    }
    private void RequestInterstitial()
    {
        #if UNITY_EDITOR
            string adUnitId = "unused";
        #elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-6132620455403301/7079458076";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-6132620455403301/4125991675";
        #else
            string adUnitId = "unexpected_platform";
        #endif

        // Create an interstitial.
        interstitial = new InterstitialAd(adUnitId);
        // Register for ad events.
        interstitial.AdLoaded += HandleInterstitialLoaded;
        interstitial.AdFailedToLoad += HandleInterstitialFailedToLoad;
        interstitial.AdOpened += HandleInterstitialOpened;
        interstitial.AdClosing += HandleInterstitialClosing;
        interstitial.AdClosed += HandleInterstitialClosed;
        interstitial.AdLeftApplication += HandleInterstitialLeftApplication;
        GoogleMobileAdsDemoHandler handler = new GoogleMobileAdsDemoHandler();
        interstitial.SetInAppPurchaseHandler(handler);
        // Load an interstitial ad.
        interstitial.LoadAd(createAdRequest());
    }
    private void RequestInterstitial()
    {
#if UNITY_EDITOR
            string adUnitId = "unused";
#elif UNITY_ANDROID
            string adUnitId = "";
#elif UNITY_IPHONE
            string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Create an interstitial.
        interstitial = new InterstitialAd(adUnitId);
        // Register for ad events.
        interstitial.AdLoaded += HandleInterstitialLoaded;
        interstitial.AdFailedToLoad += HandleInterstitialFailedToLoad;
        interstitial.AdOpened += HandleInterstitialOpened;
        interstitial.AdClosing += HandleInterstitialClosing;
        interstitial.AdClosed += HandleInterstitialClosed;
        interstitial.AdLeftApplication += HandleInterstitialLeftApplication;
        GoogleMobileAdsDemoHandler handler = new GoogleMobileAdsDemoHandler();
        interstitial.SetInAppPurchaseHandler(handler);
        // Load an interstitial ad.
        interstitial.LoadAd(createAdRequest());
    }
Esempio n. 6
0
    private void RequestInterstitial()
    {
        #if UNITY_ANDROID
        string adUnitId = "Ica-app-pub-6695715042527152/8720779823";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-6695715042527152/8720779823";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create an interstitial.
        interstitial = new InterstitialAd(adUnitId);
        // Register for ad events.
        interstitial.AdLoaded += HandleInterstitialLoaded;
        interstitial.AdFailedToLoad += HandleInterstitialFailedToLoad;
        interstitial.AdOpened += HandleInterstitialOpened;
        interstitial.AdClosing += HandleInterstitialClosing;
        interstitial.AdClosed += HandleInterstitialClosed;
        interstitial.AdLeftApplication += HandleInterstitialLeftApplication;
        GoogleMobileAdsDemoHandler handler = new GoogleMobileAdsDemoHandler();
        interstitial.SetInAppPurchaseHandler(handler);
        // Load an interstitial ad.
        interstitial.LoadAd(createAdRequest());
    }
    private void RequestInterstitial()
    {
        #if UNITY_EDITOR
            string adUnitId = "unused";
        #elif UNITY_ANDROID
			string adUnitId = "/168212774/NoahTestAndroid";
        #elif UNITY_IPHONE
			string adUnitId = "/168212774/NoahTest";
        #else
            string adUnitId = "unexpected_platform";
        #endif

		Debug.Log("adUnitId: " + adUnitId);

        // Create an interstitial.
        interstitial = new InterstitialAd(adUnitId);
        // Register for ad events.
        interstitial.AdLoaded += HandleInterstitialLoaded;
        interstitial.AdFailedToLoad += HandleInterstitialFailedToLoad;
        interstitial.AdOpened += HandleInterstitialOpened;
        interstitial.AdClosing += HandleInterstitialClosing;
        interstitial.AdClosed += HandleInterstitialClosed;
        interstitial.AdLeftApplication += HandleInterstitialLeftApplication;
        GoogleMobileAdsDemoHandler handler = new GoogleMobileAdsDemoHandler();
        interstitial.SetInAppPurchaseHandler(handler);
        // Load an interstitial ad.
        interstitial.LoadAd(createAdRequest());
    }