Hi,
in the last version of ads, there is no isReady function.
So, how can we check if ads is ready (loaded)?
Hi,
In SDK versions 3.7.0 and higher, you can use the IUnityAdsLoadListener and IUnityAdsShowListener callbacks to implement logic for when content succeeds or fails to load or show respectively.
So you can use this to check if ads are loaded ok
// Implement Load Listener and Show Listener interface methods:
public void OnUnityAdsAdLoaded(string adUnitId)
{
// Optionally execute code if the Ad Unit successfully loads content.
}
Please refer to this guide page to understand it
https://docs.unity.com/ads/ImplementingBasicAdsUnity.htm
https://docs.unity.com/ads/ImplementingRewardedAdsUnity.htm
in my story, it is a little bit different than that is. I already use OnUnityAdsAdLoaded.
But somehow ad is not loading. therefore I check every second if ads is initlized and load ads.
but of course, it can be dangerous because I over load ads server by loading ads every second.
Therefore I need to check if ads is loaded and if it is not ready I have to load it again.
You don’t need to check every second if ads is initlized and load ads.
Please check the placementId when OnUnityAdsAdLoaded is triggered, and pass this placementId in the Show method. By doing this the Ad should be shown. If not, please provide the device log so we can check it.
this causes a vicious circle. How can I check if ad is loaded by loading it? I need to check it before I try to load it again and obviously isadsready function was a great solution for it.
And I am just wondering are you working as 2 teams. The first team (which is the great one) produce something (function and variables) very useful and second team comes and say “Lets depracate it” but why?
while it works as needed
Why am I really considered in every update of you by thinking “O God what did they ruin this time, I hope not something I am using now”…
Hey, OnUnityAdsAdLoaded will be called when the ad is loaded. So you can use the OnUnityAdsAdLoaded
For example, you can enable the ad button when the ad is loaded.
// 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;
}
}
honey, i am already doing it but the problem is that I load ads at the beginning of the level (because it is not predictable when will I need it, when the player will finish the game) and if I wait too long (the player plays the game for a few minutes) the ads goes away. So I need to check if the loaded ads is still fresh. Otherwise, my rewarded ads button becomes useless. This is what I see if I am not wrong.
The loaded ads shouldn’t go away, it’s not expected behavior. If you can reproduce it, please provide the device log so we can investigate further.