/// <summary> /// 広告読み込み処理 /// </summary> private void RequestBanner() { // バナー広告IDを設定 #if UNITY_ANDROID string adUnitId = GameUtil.Const.ADMOB_ANDROID_BANNER_ID; #elif UNITY_IPHONE string adUnitId = GameUtil.Const.ADMOB_IOS_BANNER_ID; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public static void RequestBanner() { // Create a 320x50 banner at the top of the screen. bannerView = new BannerView("ca-app-pub-3940256099942544/6300978111", AdSize.Banner, AdPosition.Bottom); // Called when an ad request has successfully loaded. bannerView.OnAdLoaded += HandleOnAdLoaded; // Called when an ad request failed to load. bannerView.OnAdFailedToLoad += HandleOnAdFailedToLoad; // Called when an ad is clicked. bannerView.OnAdOpening += HandleOnAdOpened; // Called when the user returned from the app after an ad click. bannerView.OnAdClosed += HandleOnAdClosed; // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
void BannerReklamAl() { bannerReklam = new BannerView(bannerID, AdSize.SmartBanner, AdPosition.Top); AdRequest reklamiAl; if (testMod) { reklamiAl = new AdRequest.Builder().AddTestDevice(AdRequest.TestDeviceSimulator) .AddTestDevice(testDeviceID).Build(); } else { reklamiAl = new AdRequest.Builder().Build(); } bannerReklam.LoadAd(reklamiAl); bannerReklam.Hide(); }
/// <summary> /// Create new banner, register all the events and load it automatically. /// </summary> /// <param name="position">The new banner will be placed at this position.</param> /// <param name="size">Size of the new banner.</param> /// <param name="bannerId">Id to request new banner.</param> private BannerView CreateNewBanner(BannerAdPosition position, BannerAdSize size, string bannerId) { BannerView newBanner = new BannerView( bannerId, ToAdMobAdSize(size), ToAdMobAdPosition(position) ); /// Register for banner ad events. newBanner.OnAdLoaded += HandleAdMobBannerAdLoaded; newBanner.OnAdFailedToLoad += HandleAdMobBannerAdFailedToLoad; newBanner.OnAdOpening += HandleAdMobBannerAdOpening; newBanner.OnAdClosed += HandleAdMobBannerAdClosed; newBanner.OnAdLeavingApplication += HandleAdMobBannerAdLeftApplication; newBanner.LoadAd(CreateAdMobAdRequest()); return(newBanner); }
private void RequestBanner() { #if UNITY_ANDROID string adUnitId = "ca-app-pub-2260202932541442/9817494475"; #elif UNITY_IPHONE string adUnitId = "ca-app-pub-2260202932541442/2239878045"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public override void PrepareBanner() { base.PrepareBanner(); #if ADS_ADMOB var bannerView = new BannerView(BannerID, AdSize.Banner, AdPosition); var request = new AdRequest.Builder(); if (!TestDevices.Empty()) { request.AddTestDevice(AdRequest.TestDeviceSimulator); foreach (var device in TestDevices) { request.AddTestDevice(device); } } bannerView.LoadAd(request.Build()); BannerView = bannerView; #endif }
private void RequestBanner() { #if UNITY_EDITOR string adUnitId = "unused"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-1991895393724672/8973896544"; #elif UNITY_IPHONE string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE"; #else string adUnitId = "unexpected_platform"; #endif bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom); bannerView.AdFailedToLoad += HandleAdFailedToLoad; bannerView.LoadAd(createAdRequest()); }
private void RequestBanner2() { //#if UNITY_ANDROID //#elif UNITY_IPHONE // string adUnitId = "ca-app-pub-3940256099942544/2934735716"; //#else // string adUnitId = "unexpected_platform"; //#endif // Create a 320x50 banner at the top of the screen. bannerView2 = new BannerView(adUnitId2, AdSize.Banner, AdPosition.Top); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView2.LoadAd(request); bannerView2.Show(); }
public void RequestBannerMenuPage() { string adUnitId; #if UNITY_EDITOR adUnitId = "unused"; #elif UNITY_ANDROID adUnitId = "ca-app-pub-1224519388650129/2228742206"; #elif UNITY_IPHONE adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE"; #else adUnitId = "unexpected_platform"; #endif bannerViewMenuPage = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom); AdRequest request = new AdRequest.Builder().AddTestDevice(testDeviceId).Build(); //AdRequest request = new AdRequest.Builder ().Build (); // Load the banner with the request. bannerViewMenuPage.LoadAd(request); }
private void showBannerAd() { string adID = "ca-app-pub-9673195993619656/4605856430"; //***For Testing in the Device*** /*AdRequest request = new AdRequest.Builder() * .AddTestDevice(AdRequest.TestDeviceSimulator) // Simulator. * .AddTestDevice("2077ef9a63d2b398840261c8221a0c9b") // My test device. * .Build();*/ //***For Production When Submit App*** AdRequest request = new AdRequest.Builder().Build(); BannerView bannerAd = new BannerView(adID, AdSize.Banner, AdPosition.Top); bannerAd.LoadAd(request); Debug.Log("Showing Banner Ad"); }
public void RequestBanner() { #if UNITY_EDITOR string adUnitId = "ca-app-pub-4291038556071828/6609075398"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-4291038556071828/6609075398"; #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.Banner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public void RequestBanner() { #if UNITY_EDITOR string adUnitId = "ca-app-pub-6815622516308976/7731340248"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-6815622516308976/7731340248"; #elif UNITY_IPHONE string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE"; #else string adUnitId = "ca-app-pub-6815622516308976/7731340248"; #endif AdSize adSize = new AdSize(260, 45); // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, adSize, AdPosition.Top); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public void RequestBanner() { //TODO add suppport for Designed for Families setting https://developers.google.com/admob/android/targeting#designed_for_families_setting //TODO move test devices to class parameters // Request a banner ad, with optional custom ad targeting. AdRequest request = new AdRequest.Builder() // .AddTestDevice(AdRequest.TestDeviceSimulator) .AddTestDevice("A431B6F2AB563BE62EAC8CBB5ECCD43F") // Mark S2 .AddTestDevice("6e2d8b66674d9ef3225b90cb584e5975") .AddTestDevice("C359AF1E66C7AFFCC94663B0EEF0D544") // Galaxy Alpha .AddKeyword("game") .SetGender(Gender.Male) //TODO - give the user some way of setting these (need to mention in privacy policy if so). .SetBirthday(new System.DateTime(1985, 1, 1)) .TagForChildDirectedTreatment(TagForChildDirectedTreatment) .AddExtra("color_bg", "9B30FF") .Build(); _bannerView.LoadAd(request); }
private void ReqeustBanner() { #if UNITY_EDITOR string adUnitId = "ca-app-pub-3718238989302361/9753694939"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-3718238989302361/9753694939"; #elif UNITY_IPHONE string adUnitId = "ca-app-pub-3718238989302361/9753694939"; #else string adUnitId = "ca-app-pub-3718238989302361/9753694939"; #endif // Create a 320x50 banner at the top of the screen. BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
private void RequestBanner() { #if UNITY_EDITOR string adUnitId = "unused"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-6539635200421204/6690344170"; #elif UNITY_IPHONE string adUnitId = "ca-app-pub-6539635200421204/9709046174"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top); // Create an empty ad request. AdRequest request = new AdRequest.Builder().AddTestDevice("2077ef9a63d2b398840261c8221a0c9b").Build(); // Load the banner with the request. bannerView.LoadAd(request); }
void LoadBanner() { Debug.Log("GameController: LoadAd"); // Create a new banner view instance if needed if (_bannerView == null) { _bannerView = new BannerView(); } // Create an adconfig object that will store informations about the ad placement and use it to load the ad AdConfig adConfig = new AdConfig("https://mobile.smartadserver.com", 104808, "663262", 15140, true, ""); _bannerView.LoadAd(adConfig); // Register success & failure events _bannerView.AdViewLoadingSuccess += BannerViewSuccess; _bannerView.AdViewLoadingFailure += BannerViewFailure; }
private void RequestBanner() { #if UNITY_EDITOR string adUnitId = "unused"; #elif UNITY_ANDROID string adUnitId = bannerAdUnit; #elif UNITY_IPHONE string adUnitId = bannerAdUnit; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);//change banner position (AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
private void RequestBanner() { #if UNITY_ANDROID string adUnitId = "INSERT_ANDROID_BANNER_AD_UNIT_ID_HERE"; #elif UNITY_IPHONE string adUnitId = "ca-app-pub-8601678415603694/4490409362"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the bottom of the screen. bannerAd = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerAd.LoadAd(request); bannerAd.OnAdLoaded += HandleOnBannerAdLoaded; bannerAd.OnAdClosed += HandleOnBannerAdClosed; }
bool SA.UltimateAds.IBannerAd.Show() { #if ADMOB_ENABLED if (banner != null) { CleanUpBannerSub(banner); } banner = new BannerView(BannerUnitId, AdSize.SmartBanner, AdPosition.Top); banner.OnAdClosed += Banner_OnAdClosed; banner.OnAdFailedToLoad += Banner_OnAdFailedToLoad; banner.OnAdLeavingApplication += Banner_OnAdLeavingApplication; banner.OnAdLoaded += Banner_OnAdLoaded; banner.OnAdOpening += Banner_OnAdOpening; banner.LoadAd(this.CreateAdRequest()); #endif return(true); }
private void RequestBanner() { #if UNITY_ANDROID string adUnitId = AndroidBannerID; #elif UNITY_IPHONE string adUnitId = IOSBannerID; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom); // bannerView.OnAdLoaded += HandleEventHandler; // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
/// <summary> /// 広告読み込み処理 /// </summary> private void RequestBanner() { // バナー広告IDを設定 #if UNITY_ANDROID string adUnitId = "【バナー広告ID(Android)】"; #elif UNITY_IPHONE string adUnitId = "【バナー広告ID(iOS)】"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public void Show(string _strUnitId) { if (banner_position == POSITION.TOP) { view = new BannerView(_strUnitId, AdSize.Banner, AdPosition.Top); } else { view = new BannerView(_strUnitId, AdSize.Banner, AdPosition.Bottom); } // Create an empty ad request. AdRequest request = new AdRequest.Builder() .AddTestDevice("B58A62380C00BF9DC7BA75C756B5F550") .AddTestDevice("30ec665ef7c68238905003e951174579") .Build(); // Load the banner with the request. view.LoadAd(request); }
public static void RequestBanner() { #if UNITY_ANDROID string adUnitId = "ca-app-pub-5267056163100832/1015642937"; #elif UNITY_IPHONE string adUnitId = "ca-app-pub-5267056163100832/8372809658"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder() //.AddTestDevice("E3A02A722AB404CB395263041F75D461") .Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public void RequestBanner() { #if UNITY_EDITOR string adUnitId = "unused"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-2389250670002713/5842493436"; #elif UNITY_IPHONE string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the bottom of the screen. bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
private void RequestBanner() { #if UNITY_EDITOR string adUnitId = "unused"; #elif UNITY_ANDROID string adUnitId = "You UNIT-ID HERE"; #elif UNITY_IPHONE string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the bottom of the screen. BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public void RequestBannerAd() { bBannerShow = true; string adUnitId = string.Empty; #if UNITY_ANDROID //adUnitId = test_adUnitId; adUnitId = android_banner_id; #elif UNITY_IOS adUnitId = ios_banner_id; #endif AdSize adSize = new AdSize(320, (int)(Screen.height * 0.016f)); bannerView = new BannerView(adUnitId, adSize, AdPosition.Top); AdRequest request = new AdRequest.Builder().Build(); bannerView.LoadAd(request); bannerView.Show(); }
private void RequestBanner() { #if UNITY_ANDROID string adUnitId = "ca-app-pub-9179569099191885/5063076807"; #elif UNITY_IPHONE string adUnitId = "ca-app-pub-3940256099942544/2934735716"; #else string adUnitId = "unexpected_platform"; #endif // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
private void RequestBanner() { // 広告ユニットID これはテスト用 //string adUnitId = "ca-app-pub-3940256099942544/6300978111"; string adUnitId = "ca-app-pub-5584040938629320/5640398168"; // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.TopRight); // Create an empty ad request. AdRequest request = new AdRequest.Builder() .Build(); // Load the banner with the request. bannerView.LoadAd(request); // Create a 320x50 banner at the top of the screen. //bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top); }
private void RequestBanner() { #if UNITY_EDITOR string adUnitId = "ca-app-pub-5011152033559148/1082319173"; #elif UNITY_ANDROID string adUnitId = "ca-app-pub-5011152033559148/1082319173"; #elif UNITY_IPHONE string adUnitId = ""; #else string adUnitId = ""; #endif AdSize adSize = new AdSize(320, 50); // Create a 320x50 banner at the top of the screen. bannerView = new BannerView(adUnitId, adSize, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); }
public void RequestBanner() { if (showBanner) { return; } #if UNITY_EDITOR string adId = SGAdvertising.testBanner; #elif UNITY_ANDROID string adId = androidAdID; #elif UNITY_IPHONE string adId = iosAdID; #else string adId = SGAdvertising.testBanner; #endif // test mode if (SGDebug.DebugMode) { adId = SGAdvertising.testBanner; } //ref: https://developers.google.com/admob/unity/banner#banner_sizes //AdSize adSize = new AdSize(320, 50); //BANNER = 320x50 bannerView = new BannerView(adId, AdSize.Banner, AdPosition.Bottom); // Create an empty ad request. AdRequest request = new AdRequest.Builder().Build(); // Load the banner with the request. bannerView.LoadAd(request); // Called when an ad request has successfully loaded. bannerView.OnAdLoaded += HandleOnAdLoaded; // Called when an ad request failed to load. bannerView.OnAdFailedToLoad += HandleOnAdFailedToLoad; // Called when an ad is clicked. bannerView.OnAdOpening += HandleOnAdOpened; // Called when the user returned from the app after an ad click. bannerView.OnAdClosed += HandleOnAdClosed; // Called when the ad click caused the user to leave the application. bannerView.OnAdLeavingApplication += HandleOnAdLeavingApplication; }