Here is an example of the code I wrote. OnInitializationComplete
is executed, it starts loading that does not call any of the OnUnityAdsFailedToLoad
OnUnityAdsAdLoaded
methods. From this, I concluded that the download takes a very long time or the listener methods are not called. What to do in such a situation? Everything works fine in unity, it takes a long time to load only on android.
public TextMeshProUGUI text;
private void Start()
{
StartCoroutine(Timer());
}
private IEnumerator Timer()
{
yield return new WaitForSeconds(1);
Advertisement.Initialize("5317868", testMode: true, enablePerPlacementLoad: false, this);
}
public void OnUnityAdsAdLoaded(string placementId)
{
text.text = "Loaded";
Advertisement.Show("Interstitial_Android");
}
public void OnUnityAdsFailedToLoad(string placementId, UnityAdsLoadError error, string message)
{
text.text = "UNLoaded";
}
public void OnInitializationComplete()
{
text.text = "init done";
Advertisement.Load("Interstitial_Android", this);
}
public void OnInitializationFailed(UnityAdsInitializationError error, string message)
{
text.text = "UnINIT";
}
I tried to do it through the coroutine and without it. the result is the same. I also tried without a listener, but in this case, even the initialization fails