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;
    }
	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);
	}
Beispiel #3
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;
    }
    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;
    }
	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 #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);
 }
 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);
 }
Beispiel #9
0
 public void LoadAdmobInterstial()
 {
     interstialAd = new InterstitialAd (INTERSTIAL_ID);
     AdRequest request = new AdRequest.Builder ().Build ();
     if (!interstialAd.IsLoaded ()) {
         interstialAd.LoadAd (request);
     }
 }
	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);

	}
    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 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 #13
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 #14
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 #15
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
 }
Beispiel #16
0
    private void RequestInterstitialAds()
    {
        string text     = "ca-app-pub-3411062052281263/9258044518";
        string adUnitId = text;

        interstitial = new GoogleMobileAds.Api.InterstitialAd(adUnitId);
        AdRequest request = new AdRequest.Builder().Build();

        interstitial.OnAdClosed += Interstitial_OnAdClosed;
        interstitial.LoadAd(request);
        UnityEngine.Debug.Log("AD LOADED XXX");
    }
    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());
    }
	private static void RequestInterstitialAds2()
	{
		try
		{
			string text = "ca-app-pub-3411062052281263/9258044518";
			string adUnitId = text;
			interstitial2 = new GoogleMobileAds.Api.InterstitialAd(adUnitId);
			AdRequest request = new AdRequest.Builder().Build();
			interstitial2.LoadAd(request);
			interstitial2.OnAdClosed += Interstitial_OnAdClosed;
		}
		catch (Exception)
		{
		}
	}
Beispiel #20
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);
    }
	private static void RequestInterstitialAds()
	{
		try
		{
			string text = "ca-app-pub-3411062052281263/8502865308";
			string adUnitId = text;
			interstitial = new GoogleMobileAds.Api.InterstitialAd(adUnitId);
			AdRequest request = new AdRequest.Builder().Build();
			interstitial.LoadAd(request);
			interstitial.OnAdClosed += Interstitial_OnAdClosed;
			interstitial.OnAdFailedToLoad += Interstitial_OnFailToLoad;
		}
		catch (Exception)
		{
		}
	}
Beispiel #22
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 #23
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 #24
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());
    }
Beispiel #25
0
        private void LoadAd()
        {
            if (null != interstitial)
            {
                interstitial.Destroy();
            }

            interstitial                         = new GoogleMobileAds.Api.InterstitialAd(ad_unit_id);
            interstitial.OnAdLoaded             += HandleOnAdLoaded;
            interstitial.OnAdFailedToLoad       += HandleOnAdFailedToLoad;
            interstitial.OnAdOpening            += HandleOnAdOpened;
            interstitial.OnAdClosed             += HandleOnAdClosed;
            interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;

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

            interstitial.LoadAd(request);
        }
Beispiel #26
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;
    }
    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 #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);
    }
Beispiel #31
0
	private void RequestInterstitial()
	{
		#if UNITY_EDITOR
		string adUnitId = "unused";
		#elif UNITY_ANDROID
		string adUnitId = "Insertar su ID aqui";
		#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;
		// Load an interstitial ad.
		interstitial.LoadAd(createAdRequest());
	}
	private static void CreateInterstitialRequest()
	{
		#if ADMOB_IMPLEMENTED

		#if UNITY_ANDROID
		string adUnitId = Instance.interstitialAndroid;
		#elif UNITY_IPHONE
		string adUnitId = Instance.interstitialIOS;
		#else
		string adUnitId = "unexpected_platform";
		#endif

		// Initialize an InterstitialAd.
		interstitial = new InterstitialAd(adUnitId);
		// Create an empty ad request.
		AdRequest.Builder request = new AdRequest.Builder();

		//add test devices
		foreach(DeviceID device in Instance.testDevices)
			request.AddTestDevice(device.id);

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

		#endif
	}
    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());
    }
Beispiel #34
0
 private void requestInterstitial()
 {
     GoogleMobileAds.Api.AdRequest request = new GoogleMobileAds.Api.AdRequest.Builder().Build();
     interstitialAd.LoadAd(request);
 }
Beispiel #35
0
    private void CreateInterstitial()
    {
        try
        {
            var interstitialId = String.Empty;

        #if UNITY_ANDROID && !UNITY_EDITOR
            interstitialId = "ca-app-pub-8526262957509496/1817366765";
        #endif
        //#if UNITY_IOS && !UNITY_EDITOR
        //        interstitialId = "ca-app-pub-8526262957509496/1817366765";
        //#endif
            if (String.IsNullOrEmpty(interstitialId))
                return;

            // Initialize an InterstitialAd.
            var interstitial = new InterstitialAd(interstitialId);
            // Create an empty ad request.
            var request = new AdRequest.Builder()
        #if DEBUG
                .AddTestDevice(AdRequest.TestDeviceSimulator)
        #endif
                .AddTestDevice("98446DEEDA9D51B42BD040E4FCE04273")
                .Build();

            // Load the interstitial with the request.
            interstitial.AdOpened += (sender, args) =>
            {
                AdTaps++;
                if (AdTaps != 16) return;
                DeleteInterstitial();
            };

            interstitial.LoadAd(request);

            if (!interstitialAd.IsLoaded())
                StartCoroutine(InterstitialAdCoroutine());
            else
                interstitialAd.Show();
        }
        catch (Exception ex)
        {
            LogFile.Message(ex.Message + ex.StackTrace);
        }
    }
Beispiel #36
0
 public void Load()
 {
     _ad.LoadAd(new gmd.AdRequest.Builder().Build());
 }