V
V
Valentine2019-08-09 22:47:11
Unity
Valentine, 2019-08-09 22:47:11

Why doesn't the banner in Unity Ads work?

Here is a script snippet:

using UnityEngine.Monetization;

    public static int lose = 0;

        if (Monetization.isSupported)
        {
            Monetization.Initialize(gameId, false);
        }

        if (lose == 5 & Monetization.IsReady("rewardedVideo"))
        {
            ShowAdCallbacks options = new ShowAdCallbacks();
            options.finishCallback = rewardedVideoHandleShowResult;
            ShowAdPlacementContent rewardVideoAd = Monetization.GetPlacementContent("rewardedVideo") as ShowAdPlacementContent;
            rewardVideoAd.Show(options);
        }

        if (Monetization.IsReady("banner"))
        {
            ShowAdCallbacks bannerOptions = new ShowAdCallbacks();
            ShowAdPlacementContent bannerAd = Monetization.GetPlacementContent("banner") as ShowAdPlacementContent;
            bannerAd.Show(bannerOptions);
        }

The banner does not appear. All other types of advertising work. Naturally, in the Unity Ads settings, I added a banner and gave it the name "banner"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Gaydak, 2019-08-10
@MrMureno

What does Monetization.IsReady("banner") return?
maybe you just turned it on and the servers haven't added anything to your ad yet. sometimes it happens that only after the first N users or requests is inflated.
If everything is set up and other ads from the unit show ads, just try to wait 24 hours or look in the log in more detail on the device (suddenly swears or writes the reason).

H
HEDAX, 2019-10-09
@HEDAX

It worked for me when I added a link to the game in the settings on the unity ads site

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question