Answer the question
In order to leave comments, you need to log in
How to create rewarded ads?
Hello, I'm using Google Mobile Ads. Created 3 banners. Regular, Interstitial and Rewarded.
The first two work, but the third for some reason refuses. I did everything as instructed.
Here is the code :
using GoogleMobileAds.Api;
.....
void Start()
{
MobileAds.Initialize("ca-app-pub-00000000000000~9000000000");
this.rewardBasedVideo = RewardBasedVideoAd.Instance;
AdRequest requestReward = new AdRequest.Builder().Build();
rewardBasedVideo.LoadAd(requestReward, reward_video);
rewardBasedVideo.OnAdLoaded += OnAdLoaded;
rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoLoaded;
}
private void OnAdLoaded(object sender, System.EventArgs args)
{
if (rewardBasedVideo.IsLoaded())
rewardBasedVideo.Show();
}
public void HandleRewardBasedVideoLoaded(object sender, Reward args)
{
// Добавляем очки за просмотр
Scores += 20;
}
public void AdvReward()
{
rewardBasedVideo.OnAdLoaded += OnAdLoaded;
rewardBasedVideo.Show();
}
Answer the question
In order to leave comments, you need to log in
Maybe the video won't load?
Make 2 buttons, download and view ads.
After launching the application, click on download ads and wait 3 seconds, then click on the button to watch ads.
If the ad does not work, then display the text with the sequence of actions in the UI, the log.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question