public static RewardedVideoAd InitRewardVideo(Activity activity) { try { var isPro = ListUtils.MyUserInfoList.FirstOrDefault()?.IsPro ?? 0; if (isPro == 0 && AppSettings.ShowFbRewardVideoAds) { if (CountRewarded == AppSettings.ShowAdMobRewardedVideoCount) { InitializeFacebook.Initialize(activity); CountRewarded = 0; var rewardVideoAd = new RewardedVideoAd(activity, AppSettings.AdsFbRewardVideoKey); rewardVideoAd.SetAdListener(new MyRRewardVideoAdListener(activity, rewardVideoAd)); rewardVideoAd.LoadAd(); //RewardVideoAd.SetRewardData(new RewardData("YOUR_USER_ID", "YOUR_REWARD")); return(rewardVideoAd); } CountRewarded++; } return(null); } catch (Exception e) { Console.WriteLine(e); return(null); } }
public static RewardedVideoAd InitRewardVideo(Activity activity) { try { if (AppSettings.ShowFbRewardVideoAds) { if (CountRewarded == AppSettings.ShowAdMobRewardedVideoCount) { InitializeFacebook.Initialize(activity); CountRewarded = 0; var rewardVideoAd = new RewardedVideoAd(activity, AppSettings.AdsFbRewardVideoKey); #pragma warning disable 618 rewardVideoAd.SetAdListener(new MyRRewardVideoAdListener(activity, rewardVideoAd)); #pragma warning restore 618 rewardVideoAd.LoadAd(); //RewardVideoAd.SetRewardData(new RewardData("YOUR_USER_ID", "YOUR_REWARD")); return(rewardVideoAd); } CountRewarded++; } return(null !); } catch (Exception e) { Methods.DisplayReportResultTrack(e); return(null !); } }