S
S
Sergey Panov2018-07-01 12:39:38
Unity
Sergey Panov, 2018-07-01 12:39:38

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();
    }

All this I want to be shown on the button. I hang on the AdvReward () button and as a result nothing happens at all.
Neither when starting the game, nor when pressing the button. The logs in Unity itself write that the banner opens and is shown (when loading, it is loaded, when the button is clicked, it is shown).
5b38a0ea10fdb579100371.png
But in the end, nothing happens on the phone.
There is no mediation group in AdMob, just a rewarded ad.
Please help me solve the problem. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-07-11
@select8

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 question

Ask a Question

731 491 924 answers to any question