Rewarded Ads Button not interacteble

I’m using Unity 2019.4.17f1 and Advertisement package version 3.7.5 as can be seen below.

I enabled ADS in Services and Enabled test mode.

Globally, I created an Empty GameObject called AdsInitializer and attached the AdsInitializer.cs script from here: Unity developer integration guides

I add the Android ID and IOS ID from the Ad Units in the Unity Dashboard and run the scene.

Everything looks fine:

Now I create a Button and add the RewardedAdsButton.cs script from Unity developer integration guides on it.

Looks like this:

In the Game view, the button is not interactable under any circumstances. After the Awake() function in RewardedAdsButton.cs sets interactable to false it stays like that. Why can’t I press the button and get the “All seems to be working Unity screen”?

Hello Effsty,

Sorry to hear that you are having a problem. Also thank you for providing detailed information.
Did you call LoadAd() method? Why I am checking this is because,

    void Awake()
    {
        // Get the Ad Unit ID for the current platform:
        _adUnitId = (Application.platform == RuntimePlatform.IPhonePlayer)
            ? _iOsAdUnitId
            : _androidAdUnitId;

        //Disable button until ad is ready to show
        _showAdButton.interactable = false;
    }

    // Load content to the Ad Unit:
    public void LoadAd()
    {
        // IMPORTANT! Only load content AFTER initialization (in this example, initialization is handled in a different script).
        Debug.Log("Loading Ad: " + _adUnitId);
        Advertisement.Load(_adUnitId, this);
    }

    // If the ad successfully loads, add a listener to the button and enable it:
    public void OnUnityAdsAdLoaded(string adUnitId)
    {
        Debug.Log("Ad Loaded: " + adUnitId);

        if (adUnitId.Equals(_adUnitId))
        {
            // Configure the button to call the ShowAd() method when clicked:
            _showAdButton.onClick.AddListener(ShowAd);
            // Enable the button for users to click:
            _showAdButton.interactable = true;
        }
    }
  1. In Awake, the script inactivates the button. //Disable button until ad is ready to show _showAdButton.interactable = false;
  2. When UnityAds is loaded, it will set _showAdButton.Interactable = true
  3. However, If you are not calling LoadAd() the button will stay inactive.

Hence, could you try calling LoadAd() method? After calling the function, If you still having any problems, please leave a comment.

i have called the LoadAd function in the adsmanager script but still it isn’t loading. the button stays inactive. This setup works perfectly fine the unity editor but doesn’t work in the android. This problem occurs with rewarded ads and banner ads but not with interstitial ads.

I have the same problem, were you able to fix it? If yes, please how?

2 Likes

Hey, I am a bit late but:
Just call the LoadAd(); function of your script after Unity Ads initialization is completed.
I did this by calling the LoadAd(); function in the void OnInitializationComplete :slight_smile: