Beispiel #1
2
	private void RequestBanner()
	{
		#if UNITY_EDITOR
		string adUnitId = "unused";
		#elif UNITY_ANDROID
		string adUnitId = "ca-app-pub-6450638975031579/7991664041";
		#elif UNITY_IPHONE
		string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
		#else
		string adUnitId = "unexpected_platform";
		#endif
		
		// Create a smartBanner banner
		bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
		// Register for ad events.
		bannerView.AdLoaded += HandleAdLoaded;
		bannerView.AdFailedToLoad += HandleAdFailedToLoad;
		bannerView.AdOpened += HandleAdOpened;
		bannerView.AdClosing += HandleAdClosing;
		bannerView.AdClosed += HandleAdClosed;
		bannerView.AdLeftApplication += HandleAdLeftApplication;
		// Load a banner ad.
		bannerView.LoadAd(createAdRequest());

		bannerView.Hide();
	}
Beispiel #2
0
 void Start()
 {
     // Creacion del banner
     bannerView = new BannerView("ca-app-pub-9453927455644163/4445153938", AdSize.Banner, AdPosition.Bottom);
     // Creacion de la peticion de anuncio
     request = new AdRequest.Builder().Build();
     bannerView.LoadAd(request);
     bannerView.Hide();
 }
Beispiel #3
0
    void RequestHomeBannerView()
    {
#if UNITY_ANDROID
        string adUnitID = "ca-app-pub-8295605020027148/4775531117";
#elif UNITY_IPHONE
        string adUnitID = "ca-app-pub-8295605020027148/4855719914";
#endif
        //AdSize size = new AdSize(900, 300);
        bannerHome = new BannerView(adUnitID, AdSize.Banner, AdPosition.BottomLeft);
        AdRequest request = new AdRequest.Builder().Build();
        bannerHome.LoadAd(request);
        bannerHome.AdFailedToLoad += Banner_AdFailedToLoad;
        bannerHome.Hide();

    }
Beispiel #4
0
    void RequestBanner()
    {
        #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-3826667266162758/5649393422";
        #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
        bannerView.Hide ();
    }
Beispiel #5
0
    void Start()
    {
        #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-1685157087617386/5409201759";
        #else
        string adUnitId = "unexpected_platform";
        #endif

        // Create a 320x50 banner at the top of the screen.
        AdPosition adPos = AdPosition.Bottom;
        if (Application.loadedLevelName == "LogrosScene") {
            adPos = AdPosition.Top;
        }
        bannerView = new BannerView(adUnitId, AdSize.Banner, adPos);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
        if (Application.loadedLevelName == "GameScene") {
            bannerView.Hide ();
        } else {
            bannerView.Show ();
        }
    }
Beispiel #6
0
    void RequestTopBannerView()
    {
#if UNITY_ANDROID
        string adUnitID = androidBannerUnitId;
#elif UNITY_IPHONE
        string adUnitID = iOSBannerUnitId;
#endif
        //AdSize size = new AdSize(900, 300);
        banner = new BannerView(adUnitID, AdSize.Banner, AdPosition.Top);
        AdRequest request = new AdRequest.Builder().Build();
        banner.LoadAd(request);
        banner.AdFailedToLoad += Banner_AdFailedToLoad;
        banner.Hide();

    }
Beispiel #7
0
    void RequestPauseBannerView()
    {
#if UNITY_ANDROID
        string adUnitID = "ca-app-pub-8295605020027148/3378986710";
#elif UNITY_IPHONE
        string adUnitID = ""ca-app-pub-8295605020027148/6332453116;
#endif
        //AdSize size = new AdSize(900, 300);
        bannerPause = new BannerView(adUnitID, AdSize.Banner, AdPosition.Bottom);
        AdRequest request = new AdRequest.Builder().Build();
        bannerPause.LoadAd(request);
        // bannerPause.AdFailedToLoad += Banner_AdFailedToLoad;
        bannerPause.Hide();
    }
Beispiel #8
-1
    private void RequestBanner()
    {
        #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-0119739277456732/9607267301";
        string adUnitIdI = "ca-app-pub-0119739277456732/5307518505";
        #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-0119739277456732/6982728107";
        string adUnitIdI = "ca-app-pub-0119739277456732/7702581707";
        #else
        string adUnitId = "unexpected_platform";
        string adUnitIdI = "unexpected_platform";
        #endif

        bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
        bannerView.LoadAd(new AdRequest.Builder().Build());
        bannerView.Hide();

        interstitial = new InterstitialAd(adUnitIdI);
        interstitial.LoadAd(new AdRequest.Builder().Build());
    }