public AdsInterstitialImplementation(List<string>testDevices = null)
        {
			requestBuilder = new AdRequest.Builder();
			if (testDevices != null)
			{
				foreach (var id in testDevices)
					requestBuilder.AddTestDevice(id);
				requestBuilder.AddTestDevice(AdRequest.DeviceIdEmulator);
			}
        }
예제 #2
0
		private AdRequest.Builder CreateBuilder()
		{
			var builder = new AdRequest.Builder();
			if (!string.IsNullOrEmpty(TestDeviceID))
			{
				builder.AddTestDevice(TestDeviceID);
			}
			return builder;
		}
예제 #3
0
    //a_184856526086757532 | 2E3F6BCDA4B35480858F6A3DABA5555F
    private AdRequest GetAdRequest()
    {
        AdRequest.Builder builder = new AdRequest.Builder();;
        for (int i = 0; i < _admobData.TestUserInfos.Length; i++)
        {
            builder.AddTestDevice(_admobData.TestUserInfos[i].DeviceId);
        }

        return(builder.Build());
    }
        public static AdRequest GetAdRequest (bool addTestDevice)
        {
            var testDeviceId = "9CCC83D186F2A2DF954788ACE76F5F41";
            var builder = new AdRequest.Builder ();

            if (addTestDevice)
                builder.AddTestDevice (testDeviceId);

            return builder.Build ();
        }
예제 #5
0
        private AdRequest.Builder CreateBuilder(bool isTest)
        {
            AdRequest.Builder builder = new AdRequest.Builder();
            if (isTest)
            {
                builder.AddTestDevice(AdmobHelper.DeviceId);
            }

            return(builder);
        }
예제 #6
0
        public static AdRequest GetAdRequest (bool addTestDevice)
        {
            var testDeviceId = "BC2508B19A2078B6AC72133BB7E6E177";
            var builder = new AdRequest.Builder ();

            if (addTestDevice)
                builder.AddTestDevice (testDeviceId);

            return builder.Build ();
        }
예제 #7
0
    public void BuildInterstitial()
    {
        failedLoading = false;
        interstitial  = new InterstitialAd(adUnitID);
        // Events
        interstitial.AdClosed          += HandleInterstitialClosed;
        interstitial.AdClosing         += HandleInterstitialClosing;
        interstitial.AdFailedToLoad    += HandleInterstitialFailedToLoad;
        interstitial.AdLeftApplication += HandleLeftApplication;
        interstitial.AdLoaded          += HandleLoaded;
        interstitial.AdOpened          += 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);
    }
예제 #8
0
        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
        }
예제 #9
0
    private AdRequest getAdRequest()
    {
        // Creating the request builder
        AdRequest.Builder requestBuilder = new AdRequest.Builder();

        // Test devices
        if (useEmulatorAsATestDevice)
        {
            requestBuilder.AddTestDevice(AdRequest.TestDeviceSimulator);
        }
        foreach (string deviceID in testDevices)
        {
            if (!string.IsNullOrEmpty(deviceID))
            {
                requestBuilder.AddTestDevice(deviceID);
            }
        }

        // Keywords
        string[] words = keywords.Split(',');
        foreach (string word in words)
        {
            if (word.Trim() != string.Empty)
            {
                requestBuilder.AddKeyword(word.Trim());
            }
        }

        // Gender
        if (gender != Gender.Unknown)
        {
            requestBuilder.SetGender(gender);
        }

        // Tag for child directed treatment
        if (tagForChildDirectedTreatment != TagForChildDirectedTreatment.NotTagged)
        {
            requestBuilder.TagForChildDirectedTreatment(tagForChildDirectedTreatment == TagForChildDirectedTreatment.True);
        }

        return(requestBuilder.Build());
    }
        public static AdRequest GetAdRequest(bool addTestDevice)
        {
            var testDeviceId = "9CCC83D186F2A2DF954788ACE76F5F41";
            var builder      = new AdRequest.Builder();

            if (addTestDevice)
            {
                builder.AddTestDevice(testDeviceId);
            }

            return(builder.Build());
        }
예제 #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                IMethods.IApp.FullScreenApp(this);

                SetContentView(Resource.Layout.Settings_DeleteAccount_layout);

                //Set ToolBar
                var ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
                if (ToolBar != null)
                {
                    ToolBar.Title = GetText(Resource.String.Lbl_DeleteAccount);

                    SetSupportActionBar(ToolBar);
                    SupportActionBar.SetDisplayShowCustomEnabled(true);
                    SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                    SupportActionBar.SetHomeButtonEnabled(true);
                    SupportActionBar.SetDisplayShowHomeEnabled(true);
                }

                //Get values
                Txt_Password = FindViewById <EditText>(Resource.Id.Password_Edit);
                Chk_Delete   = FindViewById <CheckBox>(Resource.Id.DeleteCheckBox);
                Btn_Delete   = FindViewById <Button>(Resource.Id.DeleteButton);

                Chk_Delete.Text = GetText(Resource.String.Lbl_IWantToDelete1) + " " + UserDetails.Username + " " +
                                  GetText(Resource.String.Lbl_IWantToDelete2) + " " + AppSettings.Application_Name + " " +
                                  GetText(Resource.String.Lbl_IWantToDelete3);

                mAdView = FindViewById <AdView>(Resource.Id.adView);
                if (AppSettings.Show_ADMOB_Banner)
                {
                    mAdView.AdSize     = AdSize.LargeBanner;
                    mAdView.Visibility = ViewStates.Visible;
                    string android_id = Android.Provider.Settings.Secure.GetString(this.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
                    var    adRequest  = new AdRequest.Builder();
                    adRequest.AddTestDevice(android_id);
                    mAdView.LoadAd(adRequest.Build());
                }
                else
                {
                    mAdView.Pause();
                    mAdView.Visibility = ViewStates.Gone;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
예제 #12
0
        public static AdRequest GetAdRequest(bool addTestDevice)
        {
            var testDeviceId = "BC2508B19A2078B6AC72133BB7E6E177";
            var builder      = new AdRequest.Builder();

            if (addTestDevice)
            {
                builder.AddTestDevice(testDeviceId);
            }

            return(builder.Build());
        }
예제 #13
0
        private void CreateNativeControl(MTAdView myMtAdView, string adsId, bool?personalizedAds)
        {
            if (_adView != null)
            {
                return;
            }

            _adUnitId = !string.IsNullOrEmpty(adsId) ? adsId : CrossMTAdmob.Current.AdsId;

            if (string.IsNullOrEmpty(_adUnitId))
            {
                Console.WriteLine("You must set the adsID before using it");
            }

            var listener = new MyAdBannerListener();

            listener.AdClicked    += myMtAdView.AdClicked;
            listener.AdClosed     += myMtAdView.AdClosed;
            listener.AdImpression += myMtAdView.AdImpression;
            listener.AdOpened     += myMtAdView.AdOpened;

            _adView = new AdView(Context)
            {
                AdSize           = _adSize,
                AdUnitId         = _adUnitId,
                AdListener       = listener,
                LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
            };

            var requestBuilder = new AdRequest.Builder();

            if (CrossMTAdmob.Current.TestDevices != null)
            {
                foreach (var testDevice in CrossMTAdmob.Current.TestDevices)
                {
                    requestBuilder.AddTestDevice(testDevice);
                }
            }

            if ((personalizedAds.HasValue && personalizedAds.Value) || CrossMTAdmob.Current.UserPersonalizedAds)
            {
                _adView.LoadAd(requestBuilder.Build());
            }
            else
            {
                Bundle bundleExtra = new Bundle();
                bundleExtra.PutString("npa", "1");

                _adView.LoadAd(requestBuilder
                               .AddNetworkExtrasBundle(Java.Lang.Class.FromType(typeof(AdMobAdapter)), bundleExtra)
                               .Build());
            }
        }
예제 #14
0
        private void LoadInterstitial(RewardedAd interstitial)
        {
            var builder = new AdRequest.Builder();

            foreach (var d in testDevices.Devices)
            {
                builder.AddTestDevice(d);
            }
            AdRequest request = builder.Build();

            interstitial.LoadAd(request);
        }
예제 #15
0
        protected override void OnElementChanged(ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement == null)
            {
                var adView = new AdView(Context);

                switch ((Element as AdBanner).Size)
                {
                case AdBanner.Sizes.Standardbanner:
                    adView.AdSize = AdSize.Banner;
                    break;

                case AdBanner.Sizes.LargeBanner:
                    adView.AdSize = AdSize.LargeBanner;
                    break;

                case AdBanner.Sizes.MediumRectangle:
                    adView.AdSize = AdSize.MediumRectangle;
                    break;

                case AdBanner.Sizes.FullBanner:
                    adView.AdSize = AdSize.FullBanner;
                    break;

                case AdBanner.Sizes.Leaderboard:
                    adView.AdSize = AdSize.Leaderboard;
                    break;

                case AdBanner.Sizes.SmartBannerPortrait:
                    adView.AdSize = AdSize.SmartBanner;
                    break;

                default:
                    adView.AdSize = AdSize.Banner;
                    break;
                }

                // TODO: change this id to your admob id
                adView.AdUnitId = Secrets.ANDROID_BANNER_KEY;

                //this one below is the demo one
                //adView.AdUnitId = "ca-app-pub-3940256099942544/6300978111";

                var requestbuilder = new AdRequest.Builder();
                requestbuilder.AddTestDevice("8E7EBEA7A3C191F6C58B3B24977A9BE8");
                adView.LoadAd(requestbuilder.Build());

                SetNativeControl(adView);
            }
        }
        private static AdRequest BuildAdRequest()
        {
            var builder = new AdRequest.Builder();

            foreach (var testDevice in FrameworkValues.TestDevices)
            {
                builder.AddTestDevice(testDevice);
            }

            var request = builder.Build();

            return(request);
        }
예제 #17
0
        AdRequest GetRequest(Dictionary <string, string> advertisingTargetInfo)
        {
            var request = new AdRequest.Builder();

            request.AddTestDevice(AdRequest.DeviceIdEmulator);
            request.AddTestDevice("260661DE96DFEDE845160916AD01F3CA"); //samsung tablet

            //Gender
            var gender = Gender.Unknown;

            if (advertisingTargetInfo.ContainsKey(AdKeyGender))
            {
                gender = advertisingTargetInfo[AdKeyGender].Equals("female", StringComparison.InvariantCultureIgnoreCase) ? Gender.Female : Gender.Male;
                request.SetGender((int)gender);
            }

            //Location
            var location = RealmServices.GetLastUserLocation();

            if (location != null)
            {
                var loc = new Android.Locations.Location("");
                loc.Latitude  = location.Latitude;
                loc.Longitude = location.Longitude;
                loc.Accuracy  = 1;
                request.SetLocation(loc);
            }

            //Birthday
            if (advertisingTargetInfo.ContainsKey(AdKeyBirthday))
            {
                var birthday = DateTime.ParseExact(advertisingTargetInfo[AdKeyBirthday], "MM/dd/yyyy", null);
                var bith     = new Java.Util.Date(birthday.Year, birthday.Month, birthday.Day);
                request.SetBirthday(bith);
            }

            return(request.Build());
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                IMethods.IApp.FullScreenApp(this);

                // Set our view from the "Settings_Password_Layout" layout resource
                SetContentView(Resource.Layout.Settings_Password_Layout);

                //Set ToolBar
                var ToolBar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
                ToolBar.Title = this.GetText(Resource.String.Lbl_Change_Password);

                SetSupportActionBar(ToolBar);
                SupportActionBar.SetDisplayShowCustomEnabled(true);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);
                SupportActionBar.SetDisplayShowHomeEnabled(true);

                //Get values
                Txt_CurrentPassword = FindViewById <EditText>(Resource.Id.CurrentPassword_Edit);
                Txt_NewPassword     = FindViewById <EditText>(Resource.Id.NewPassword_Edit);
                Txt_RepeatPassword  = FindViewById <EditText>(Resource.Id.RepeatPassword_Edit);

                Txt_linkForget = FindViewById <TextView>(Resource.Id.linkText);
                Txt_Save       = FindViewById <TextView>(Resource.Id.toolbar_title);

                //Show Ads
                mAdView = FindViewById <AdView>(Resource.Id.adView);
                if (AppSettings.Show_ADMOB_Banner)
                {
                    mAdView.Visibility = ViewStates.Visible;
                    string android_id = Android.Provider.Settings.Secure.GetString(this.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
                    var    adRequest  = new AdRequest.Builder();
                    adRequest.AddTestDevice(android_id);
                    mAdView.LoadAd(adRequest.Build());
                }
                else
                {
                    mAdView.Pause();
                    mAdView.Visibility = ViewStates.Invisible;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #19
0
        private AdView CreateAdView(AdBanner.Sizes size)
        {
            var adView = new AdView(Context)
            {
                AdUnitId = //"ca-app-pub-3940256099942544/6300978111"  //dummy google test ad
                           "YOUR AD UNIT ID HERE"
            };

            switch ((Element as AdBanner).Size)
            {
            case AdBanner.Sizes.Standardbanner:
                adView.AdSize = AdSize.Banner;
                break;

            case AdBanner.Sizes.LargeBanner:
                adView.AdSize = AdSize.LargeBanner;
                break;

            case AdBanner.Sizes.MediumRectangle:
                adView.AdSize = AdSize.MediumRectangle;
                break;

            case AdBanner.Sizes.FullBanner:
                adView.AdSize = AdSize.FullBanner;
                break;

            case AdBanner.Sizes.Leaderboard:
                adView.AdSize = AdSize.Leaderboard;
                break;

            case AdBanner.Sizes.SmartBannerPortrait:
                adView.AdSize = AdSize.SmartBanner;
                break;

            default:
                adView.AdSize = AdSize.Banner;
                break;
            }


            //adView.LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);

            var requestbuilder = new AdRequest.Builder();

            requestbuilder.AddTestDevice("YOUR TEST DEVICE ID HERE");
            adView.LoadAd(requestbuilder.Build());

            return(adView);
        }
예제 #20
0
        public static AdRequest.Builder GetRequest()
        {
            bool   addBundle      = false;
            Bundle bundleExtra    = new Bundle();
            var    requestBuilder = new AdRequest.Builder();

            if (CrossMTAdmob.Current.TestDevices != null)
            {
                foreach (var testDevice in CrossMTAdmob.Current.TestDevices)
                {
                    requestBuilder.AddTestDevice(testDevice);
                }
            }

            if (!CrossMTAdmob.Current.UserPersonalizedAds)
            {
                bundleExtra.PutString("npa", "1");
                addBundle = true;
            }

            if (CrossMTAdmob.Current.UseRestrictedDataProcessing)
            {
                bundleExtra.PutString("rdp", "1");
                addBundle = true;
            }

            if (CrossMTAdmob.Current.ComplyWithFamilyPolicies)
            {
                requestBuilder.TagForChildDirectedTreatment(CrossMTAdmob.Current.ComplyWithFamilyPolicies);
                bundleExtra.PutString("max_ad_content_rating", "G");
                addBundle = true;
            }

            if (CrossMTAdmob.Current.CustomParameters.Count > 0)
            {
                foreach (KeyValuePair <string, string> param in CrossMTAdmob.Current.CustomParameters)
                {
                    bundleExtra.PutString(param.Key, param.Value);
                }
                addBundle = true;
            }

            if (addBundle)
            {
                requestBuilder = requestBuilder.AddNetworkExtrasBundle(Java.Lang.Class.FromType(typeof(AdMobAdapter)), bundleExtra);
            }

            return(requestBuilder);
        }
예제 #21
0
    // Use this for initialization
    void Start()
    {
        MobileAds.Initialize(appId);
        // 배너 광고
        bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);
        AdRequest.Builder builder = new AdRequest.Builder();
        AdRequest         request = builder.AddTestDevice(AdRequest.TestDeviceSimulator).
                                    AddTestDevice("61140F27CD138576").
                                    Build();

        //AdRequest request = builder.AddTestDevice(AdRequest.TestDeviceSimulator).Build();
        bannerView.LoadAd(request);
        bannerView.Show();
        //Debug.Log(SystemInfo.deviceUniqueIdentifier);
    }
예제 #22
0
파일: AdMob.cs 프로젝트: yoonbang/Games
    // Use this for initialization
    void Start()
    {
        interstitial             = new InterstitialAd("ca-app-pub-1897145845153789/6001981353");
        interstitial.OnAdClosed += EventAdClose;

        bannerView = new BannerView("pub-1897145845153789", AdSize.SmartBanner, AdPosition.Bottom);

        AdRequest.Builder builder = new AdRequest.Builder();
        AdRequest         request = builder.AddTestDevice(AdRequest.TestDeviceSimulator).AddTestDevice("3968A57FF28B0A54").Build();

        interstitial.LoadAd(request);

        bannerView.LoadAd(request);
        bannerView.Show();
    }
예제 #23
0
        public static AdRequest CreateAdRequest()
        {
            var request = new AdRequest.Builder();

            if (AdsMaster.settings.AdMobDebug)
            {
                request.AddTestDevice(AdRequest.TestDeviceSimulator)
                .AddTestDevice("0123456789ABCDEF0123456789ABCDEF");
            }
            return(request.Build());
            /// IMPORTANCE Khi thêm 2 dòng sau vào sẽ có thể không hiển thị banner (Báo No Fill)
            ///   .TagForChildDirectedTreatment(false)
            //    .AddExtra("color_bg", "9B30FF")
            ///
        }
예제 #24
0
    AdRequest ReklamIstegiOlustur(bool testModu)
    {
        AdRequest.Builder reklamIstegi = new AdRequest.Builder();

        if (testModu)
        {
            reklamIstegi.AddTestDevice(AdRequest.TestDeviceSimulator).AddTestDevice(testDeviceID);
        }

        if (cocuklaraYonelikReklamGoster)
        {
            reklamIstegi.TagForChildDirectedTreatment(true).AddExtra("is_designed_for_families", "true");
        }

        return(reklamIstegi.Build());
    }
예제 #25
0
    private AdRequest ReklamIstegiOlustur()
    {
        AdRequest.Builder reklamIstegi = new AdRequest.Builder();

        if (testModu && !string.IsNullOrEmpty(testDeviceID))
        {
            reklamIstegi.AddTestDevice(testDeviceID);
        }

        if (cocuklaraYonelikReklamGoster)
        {
            reklamIstegi.TagForChildDirectedTreatment(true);
        }

        return(reklamIstegi.Build());
    }
예제 #26
0
    void Ads()
    {
        // Test Device
        AdRequest.Builder builder = new AdRequest.Builder();
        builder.AddTestDevice(AdmobHelper.DeviceId);

        // Create
        BannerView m_banner = new BannerView(ADMOB_ID[0], AdSize.Banner, AdPosition.Top);

        m_banner.LoadAd(builder.Build());

        //InterstitialAd m_interstitial = new InterstitialAd(ADMOB_ID[1]);
        //m_interstitial.LoadAd(builder.Build());
        // Visibility
        m_banner.Show();
    }
예제 #27
0
        AdRequest SetupNewAdRequest()
        {
            var request = new AdRequest.Builder();

            foreach (var testDevice in TestDevices)
            {
                request.AddTestDevice(testDevice);
            }
            foreach (var keyword in KeyWords)
            {
                request.AddKeyword(keyword);
            }
            request.TagForChildDirectedTreatment(TagForChildDirectedTreatment);
            request.AddExtra("color_bg", ColorHelper.HexString((Color)BackgroundColor));
            request.SetBirthday(Birthday);
            return(request.Build());
        }
예제 #28
0
    public void RequestBanner()
    {
        string str = "";

#if UNITY_ANDROID
        str = and_banner;
#elif UNITY_IOS
        str = ios_banner;
#endif
        banner = new BannerView(str, AdSize.SmartBanner, AdPosition.Top);
        AdRequest.Builder builder = new AdRequest.Builder();

        AdRequest req = builder.AddTestDevice(AdRequest.TestDeviceSimulator).AddTestDevice("3FB7AE355826BE23").Build();
        //AdRequest req = builder.Build();

        banner.LoadAd(req);
    }
예제 #29
0
        public AdRequest CreateRequest(string type)
        {
            var builder = new AdRequest.Builder();

            if (!IgnoreTestIds)
            {
                foreach (var str in TestIds)
                {
                    builder.AddTestDevice(str);
                }
            }
            Debug.Log("Create AdRequest");
            Tracking.Instance
            .Track("ad_request", "type", type)
            .Track($"ad_request_{type}");
            return(builder.Build());
        }
예제 #30
0
    // Returns an ad request with custom ad targeting.
    private AdRequest createAdRequest()
    {
        AdRequest.Builder adReqBuilder = new AdRequest.Builder()
                                         .AddTestDevice(AdRequest.TestDeviceSimulator)
                                         .AddKeyword(adKeyword)
        ;

        string deviceID = AdsHelper.getDeviceAdMobID();

        Debug.Log("Adding Test Device ID: " + deviceID);
        if (!string.IsNullOrEmpty(deviceID))
        {
            adReqBuilder.AddTestDevice(deviceID);
        }

        return(adReqBuilder.Build());
    }
예제 #31
0
    public void RequestInterstitialAd()
    {
        string str = "";

#if UNITY_ANDROID
        str = and_inter;
#elif UNITY_IOS
        str = ios_inter;
#endif
        inter = new InterstitialAd(str);
        AdRequest.Builder builder = new AdRequest.Builder();

        AdRequest req = builder.AddTestDevice(AdRequest.TestDeviceSimulator).AddTestDevice("3FB7AE355826BE23").Build();
        //AdRequest req = builder.Build();

        inter.LoadAd(req);
        inter.OnAdClosed += EventAdClose;
    }
예제 #32
0
        public void LoadAd()
        {
            // Request
            var requestBuilder = new AdRequest.Builder();

            //            20E75139BBF24DC580420774CC012DCD
            //20949F1881259988F94C570F5D49D8E9
            //.addTestDevice("1FFA91E56002E80EC2232FD6A6053E5B")
            requestBuilder.AddTestDevice("253DD8B545DDC577263C615CE187A856");
            requestBuilder.AddTestDevice("9AC63F0BB5D8E04512D0A4ED0202C018");
            requestBuilder.AddTestDevice("17F5056C2003A19B27CF2896B7BE699D");
            requestBuilder.AddTestDevice("20E75139BBF24DC580420774CC012DCD");
            requestBuilder.AddTestDevice("20949F1881259988F94C570F5D49D8E9");
            requestBuilder.AddTestDevice("1FFA91E56002E80EC2232FD6A6053E5B");
            requestBuilder.AddTestDevice("2A26CA09A9309EE2CCDA1B239A1472D1");
            _interstitialAd.LoadAd(requestBuilder.Build());
        }
예제 #33
0
        protected override void OnElementChanged(ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);

            if ((Element is AdMobView adMobElement) && (e.OldElement == null))
            {
                var ad = new AdView(Context)
                {
                    AdSize   = AdSize.SmartBanner,
                    AdUnitId = "ca-app-pub-5340043973194653/6114982135"
                };

                var requestbuilder = new AdRequest.Builder();
                requestbuilder.AddTestDevice("E87386B52557DA63E5D592B582D47DAB");
                ad.LoadAd(requestbuilder.Build());

                SetNativeControl(ad);
            }
        }