Exemple #1
0
        public void CreateAndLoadAd()
        {
            TypeLoadingAds = TypeLoadingAds.Loading;

            _rewardedAd = new RewardedAd(_adUnitId);

            _rewardedAd.OnAdClosed         += HandleRewardedAdClosed;
            _rewardedAd.OnUserEarnedReward += HandleUserEarnedReward;
            _rewardedAd.OnAdFailedToLoad   += HandleRewardedAdFailedToLoad;
            _rewardedAd.OnAdLoaded         += HandleRewardedAdLoaded;

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

            _rewardedAd.LoadAd(request);
        }
Exemple #2
0
 private void HandleRewardedAdFailedToLoad(object sender, AdErrorEventArgs e)
 {
     TypeLoadingAds = TypeLoadingAds.Error;
 }
Exemple #3
0
 private void HandleRewardedAdLoaded(object sender, EventArgs e)
 {
     TypeLoadingAds = TypeLoadingAds.Ready;
 }