Esempio n. 1
0
        public void LoadRewardedVideo(string adUnit, MTRewardedAdOptions options = null)
        {
            if (!CrossMTAdmob.Current.IsEnabled)
            {
                return;
            }

            if (_rewardedAds == null)
            {
                CreateRewardedVideo();
            }

            if (!_rewardedAds.IsLoaded)
            {
                var requestBuilder = GetRequest();

#if !MONOANDROID81
                if (options != null)
                {
                    _rewardedAds.UserId     = options.UserId;
                    _rewardedAds.CustomData = options.CustomData;
                }
#endif
                _rewardedAds.LoadAd(adUnit, requestBuilder.Build());
            }
            else
            {
                Console.WriteLine("Rewarded Video already loaded");
            }
        }
Esempio n. 2
0
        public void LoadRewardedVideo(string adUnit, MTRewardedAdOptions options = null)
        {
            if (!CrossMTAdmob.Current.IsEnabled)
            {
                return;
            }

            //old method
            if (RewardBasedVideoAd.SharedInstance.IsReady)
            {
                OnRewardedVideoAdLoaded?.Invoke(null, null);
                return;
            }

            RewardBasedVideoAd.SharedInstance.CustomRewardString = options?.CustomData;

            var request = GetRequest();

            RewardBasedVideoAd.SharedInstance.LoadRequest(request, adUnit);

            //new method
            //if (_rewardedAd==null)
            //    _rewardedAd = new RewardedAd();
            //_rewardedAd.LoadRequest(request, completion);
        }
Esempio n. 3
0
 public void LoadRewardedVideo(string adUnit, MTRewardedAdOptions options = null)
 {
 }