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”?
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;
}
}
In Awake, the script inactivates the button. //Disable button until ad is ready to show _showAdButton.interactable = false;
When UnityAds is loaded, it will set _showAdButton.Interactable = true
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.
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