Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        // 초기화
        // 앱아이디, 배너 사이즈, 배너 위치
        m_BannerView = new BannerView("ca-app-pub-3215701313685151/6171564220", AdSize.SmartBanner, AdPosition.Bottom);

        // 전면광고
        m_InterstitialAd = new InterstitialAd("ca-app-pub-3215701313685151/7648297427");

        // 테스트 단말기 등록
        //
        AdRequest.Builder adBuilder = new AdRequest.Builder();

        // 테스트기기가 많으면 .AddTestDevice(""). 으로 계속 추가
        AdRequest adRequst = adBuilder.AddTestDevice("3AEB4134537BE358").AddTestDevice(AdRequest.TestDeviceSimulator).Build();
        // 광고 요청
        m_BannerView.LoadAd(adRequst);
        // 광고 출력
        m_BannerView.Show();

        // 광고 요청
        m_InterstitialAd.LoadAd(adRequst);
        // 이벤트 종료후 callback함수 호출 추가
        m_InterstitialAd.AdClosed += AdCloseCallback;
    }
Beispiel #2
0
	void Start () {
	
		// Keep this object around for entire game
		DontDestroyOnLoad(transform.gameObject);
		
		AdRequest request = new AdRequest.Builder().Build();
		
		// Banner view ad always present at bottom of screen
		//bannerView = new BannerView("ca-app-pub-6877754457671498/9780611568", AdSize.Banner, AdPosition.Bottom);
		//bannerView.LoadAd(request);
		
		// Interstitial ad only present before play begins
		interstitial = new InterstitialAd("ca-app-pub-6877754457671498/4235971961");

		// Register for ad events.
		interstitial.AdLoaded += delegate(object sender, System.EventArgs args) {};
		interstitial.AdFailedToLoad += delegate(object sender, AdFailedToLoadEventArgs args) {};
		interstitial.AdOpened += delegate(object sender, System.EventArgs args) {};
		interstitial.AdClosing += delegate(object sender, System.EventArgs args) {};
		interstitial.AdClosed += delegate(object sender, System.EventArgs args) {};
		interstitial.AdLeftApplication += delegate(object sender, System.EventArgs args) {};
		
		interstitial.LoadAd(request);		
		
	}
    public void RequestInterstitial()
    {
        #if UNITY_ANDROID
        string adUnitId = Android_Interstitial;
        #elif UNITY_IPHONE
        string adUnitId = ios_Interstitial;
        #else
        string adUnitId = "unexpected_platform";
        #endif

        if (is_close_interstitial == true) {
            interstitial.Destroy ();
        }

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd (adUnitId);
        // Create an empty ad request.
        request = new AdRequest.Builder ().Build ();
        // Load the interstitial with the request.
        interstitial.LoadAd (request);

        interstitial.AdClosed += HandleAdClosed;

        is_close_interstitial = false;
    }
	public void BuildInterstitial(){
		failedLoading = false;
		interstitial = new InterstitialAd(adUnitID);
		// Events
		interstitial.OnAdClosed += HandleInterstitialClosed;
		interstitial.OnAdFailedToLoad += HandleInterstitialFailedToLoad;
		interstitial.OnAdLeavingApplication += HandleLeftApplication;
		interstitial.OnAdLoaded += HandleLoaded;
		interstitial.OnAdOpening += HandleOpened;
		// AdRequest
		AdRequest.Builder builder = new AdRequest.Builder ();
		if (useEmulatorAsATestDevice) {
			builder.AddTestDevice(AdRequest.TestDeviceSimulator);
		}
		if (testDeviceIDs != null && testDeviceIDs.Length > 0) {
			foreach(string testDeviceID in testDeviceIDs){
				builder.AddTestDevice(testDeviceID);
			}
		}
		if (keywords != null && keywords.Length > 0) {
			foreach (string keyword in keywords) {
				builder.AddKeyword (keyword);
			}
		}
		if (gender.HasValue) {
			builder.SetGender (gender.Value);
		}
		if (childDirectedTreatment.HasValue) {
			builder.TagForChildDirectedTreatment (childDirectedTreatment.Value);
		}
		AdRequest request = builder.Build();
		interstitial.LoadAd(request);
	}
    private void RequestInterstitial()
    {
#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-7413680112188055/9660693727";
#elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);


        //interstitial.OnAdLoaded += HandleOnAdLoaded;
        // Called when an ad request failed to load.
        // interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;        
        // Called when the user returned from the app after an ad click.
        //interstitial.OnAdClosed += HandleOnAdClosed;
        // Called when the ad click caused the user to leave the application.
        //interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);


        rewardBasedVideo = RewardBasedVideoAd.Instance;
    }
 public void RequestInterstitial()
 {
     // Create an interstitial.
     if(interstitial == null || !loaded)
     {
         moreAG.SetActive(false);
         #if UNITY_EDITOR
         string adUnitId = "unused";
         #elif UNITY_ANDROID
         string adUnitId = "/6087/defy_gaming_apps";
         #elif UNITY_IPHONE
         string adUnitId = "/6087/defy_gaming_apps";
         #else
         string adUnitId = "unexpected_platform";
         #endif
         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;
         // Load an interstitial ad.
         interstitial.LoadAd(createAdRequest());
     }
     else
     {
         moreAG.SetActive(true);
     }
 }
Beispiel #7
0
 public static void Init()
 {
     banner = new BannerView(
        banerUnitId, AdSize.Banner, AdPosition.Bottom);
     interstitial = new InterstitialAd(interstitialId);
     interstitialReq = new AdRequest.Builder().Build();
     interstitial.LoadAd(interstitialReq);
 }
	private void requestNewInterstitial() {
		interstitialAd = new InterstitialAd("<YOUR_HASHED_DEVICE_ID>");

		requestInterstitial = new AdRequest.Builder()
			.AddTestDevice("<YOUR_HASHED_DEVICE_ID>") //Add a test device
				.Build();
		interstitialAd.LoadAd(requestInterstitial); // Load the interstitial
	}
Beispiel #9
0
 public void LoadAdmobInterstial()
 {
     interstialAd = new InterstitialAd (INTERSTIAL_ID);
     AdRequest request = new AdRequest.Builder ().Build ();
     if (!interstialAd.IsLoaded ()) {
         interstialAd.LoadAd (request);
     }
 }
 public void LoadAd()
 {
     Debug.Log("Load Ad");
     MainCamera.isBreakAdLoaded = true;
     breakAd = new InterstitialAd ("YOUR_ADD_ID");
     AdRequest adrequest = new AdRequest.Builder ().Build ();
     breakAd.LoadAd (adrequest);
 }
 private static void initializeInterstitialAd()
 {
     if(inAd != null)
     {
         inAd.Destroy();
     }
     inAd = new InterstitialAd(adUnitId);
     inAd.OnAdClosed += HandleInterstitialClosed;
 }
    void Start()
    {
        if (string.IsNullOrEmpty(c_addMobID)) return;

        interstitial = new InterstitialAd(c_addMobID);
        request = new AdRequest.Builder().Build();
        interstitial.LoadAd(request);

        interstitial.AdClosed += AdsClosed;
    }
	void CreatFullScreenBanner() {

		interstitialBanner = new InterstitialAd( GameConsts.AdIdGameOver );
		// Create an empty ad request.
		AdRequest request = new AdRequest.Builder().Build();

		// Load the interstitial with the request.
		interstitialBanner.LoadAd(request);

	}
Beispiel #14
0
 public void StartInterstitial()
 {
     #if SIMULATOR
     return;
     #endif
     #if UNITY_ANDROID || UNITY_IPHONE
     interstitial = new InterstitialAd(adUnitId);
     AdRequest request = new AdRequest.Builder().Build();
     interstitial.LoadAd(request);
     #endif
 }
    void Start()
    {
        GetComponent<AudioSource>().Play();
        startAd = new InterstitialAd ("YOUR_ADD_ID");
        isBreakAdLoaded = false;
        AdRequest adrequest =new AdRequest.Builder().Build();

        startAd.LoadAd(adrequest);
        startAd.AdLoaded += HandleAdLoaded;
        //googleAnalytics.StartSession ();
    }
Beispiel #16
0
 public static void RequestInterstitial(bool isShow)
 {
     // Initialize an InterstitialAd.
     interstitial = new InterstitialAd(adUnitIdInterstitial);
     // Create an empty ad request.
     AdRequest request = new AdRequest.Builder().Build();
     // Load the interstitial with the request.
     interstitial.LoadAd(request);
     if(isShow)
         interstitial.AdLoaded += HandleAdLoaded;
 }
Beispiel #17
0
    void ShowInterstitial()
    {
        // Initialize an InterstitialAd.
        InterstitialAd interstitial = new InterstitialAd("ca-app-pub-9688313728956513/9454822785");
        // Create an empty ad request.
        AdRequest intrequest = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(intrequest);

        interstitial.Show ();
    }
Beispiel #18
0
 public static void ShowAndDestroyInterstitialAd(InterstitialAd interstitial)
 {
     try
     {
         if (interstitial.IsLoaded())
         {
             interstitial.Show();
         }
     }
     catch (Exception e) { }
 }
Beispiel #19
0
 public void DestroyAD()
 {
     if (banner != null)
     {
         banner.Destroy();
         banner = null;
     }
     if (interstitial != null)
     {
         interstitial.Destroy();
         interstitial = null;
     }
 }
    public void LoadInterstitial()
    {
        //Initialize AdUnitId if not set
        if (adUnitInterstitialId == ""){
            InitializeAdUnitId();
        }

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitInterstitialId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }
    private void RequestInterstitial()
    {
		interstitial = new InterstitialAd(adUnitId);

        interstitial.AdLoaded += HandleInterstitialLoaded;
        interstitial.AdFailedToLoad += HandleInterstitialFailedToLoad;
        interstitial.AdOpened += HandleInterstitialOpened;
        interstitial.AdClosing += HandleInterstitialClosing;
        interstitial.AdClosed += HandleInterstitialClosed;
        interstitial.AdLeftApplication += HandleInterstitialLeftApplication;

		//interstitial.LoadAd(new AdRequest.Builder().Build());
		interstitial.LoadAd(createAdRequest());
    }
Beispiel #22
0
    private void RequestInterstitial()
    {
        #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-1215085077559999/3564479460";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-1215085077559999/5180813465";
        #endif

        // Initialize an InterstitialAd.

        interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }
Beispiel #23
0
    public void RequestInterstitial()
    {
        #if UNITY_EDITOR
        string adUnitId = "unused";
        #elif UNITY_ANDROID
            string adUnitId = "ca-app-pub-3617707839468603/8111153894";
        #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);
        // Load an interstitial ad.
        interstitial.LoadAd(createAdRequest());
    }
Beispiel #24
0
    public void ShowInterstitialAd()
    {
        isAdFinished = false;
        myAudio.PauseAudio();
        interstitial = new InterstitialAd(adUnitId);
        interstitial.OnAdLoaded += HandleOnAdLoaded;
        interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
        interstitial.OnAdClosed += HandleOnAdClosed;

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder()
            .AddTestDevice(AdRequest.TestDeviceSimulator)       // Simulator.
            .AddTestDevice("212F4933DB3419310DFEF94DC783D96D")  // K10000
            .Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
        pleaseWaitPanel.SetActive(true);
    }
Beispiel #25
0
    private void RequestInterstitial()
    {
        #if UNITY_EDITOR
        string adUnitId = "unused";
        #elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-1991895393724672/8186664146";
        #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        interstitial = new InterstitialAd(adUnitId);

        interstitial.AdFailedToLoad += HandleAdFailedToLoad;

        interstitial.LoadAd(createAdRequest());
    }
    private void RequestInterstitial()
    {
        #if UNITY_EDITOR
        string adUnitId = "unused";
        #elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-8831771291359638/3960735902";
        #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }
Beispiel #27
0
    public static InterstitialAd LoadInterstistialAd()
    {
        #if UNITY_ANDROID
                string adUnitId = "ca-app-pub-1854171409216273/6644924948";
        #elif UNITY_IPHONE
                string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
        #else
                string adUnitId = "unexpected_platform";
        #endif

        // Initialize an InterstitialAd.
        InterstitialAd interstitial = new InterstitialAd(adUnitId);

        // Load the interstitial with the request.

        interstitial.LoadAd(CreateRequest());

        return interstitial;
    }
Beispiel #28
0
    /*	public void RequestBanner()
    {
        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(
            BANNER_ID, AdSize.SmartBanner, AdPosition.Top);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder()
            //.AddTestDevice("A4D94C6CCCC78F95136843C5B0579088")
            .Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
    }*/
    public void RequestInterstitial()
    {
        #if UNITY_ANDROID
        string adUnitId = INTERSTITIAL_ID;
        #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        // ADD TEST DEVICE HERE
        AdRequest request = new AdRequest.Builder()
            .AddTestDevice("A4D94C6CCCC78F95136843C5B0579088")
                .Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }
    void Start()
    {
        if (!ControlAd.m_useAd)
        {
            return;
        }
		if (string.IsNullOrEmpty(c_interstitial_addMobID)) return;

        Debug.Log("Admob View Start");
//        bannerView = new BannerView(c_bannerView_addMobID, m_type, m_postion);
        request = new AdRequest.Builder().Build();
//        bannerView.LoadAd(request);

        interstitial = new InterstitialAd(c_interstitial_addMobID);
        interstitial.LoadAd(request);

//        bannerView.Show();

        interstitial.AdClosed += AdsClosed;

    }
Beispiel #30
0
    // Interstitial
    public void RequestInterstitial()
    {
        #if UNITY_EDITOR
        string adUnitId = "xxx";
        #elif UNITY_ANDROID
        string adUnitId = "xx";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-9144026334547134/7242351206";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        interstitial = new InterstitialAd (adUnitId);
        //		AdRequest request = new AdRequest.Builder ()
        //			.AddTestDevice (AdRequest.TestDeviceSimulator)
        //				.AddTestDevice ("0123456789ABCDEF0123456789ABCDEF")
        //				.Build ();

        AdRequest request = new AdRequest.Builder ()
                .Build ();

        interstitial.LoadAd (request);
    }