i implemted IUnityAdsListener that worked without problem but at an unknown moment it stoped to work only on android.
I added a log system to see where was the problem. it seems that after initialiaze, onUnityAdsReady void is never called… only on device.
i have the warning
Please consider upgrading to the Packman Distribution of the Unity Ads SDK. The Asset Store distribution will not longer be supported after Unity 2018.3
but i don’t know how remove propely the store version. the few attempts caused conflicts or bugs with packman version…
using UnityEngine;
using UnityEngine.Advertisements;
public class adController : MonoBehaviour, IUnityAdsListener
{
public static adController instance;
public string store_id; // i let the id public to test a wrong one.
``but it provokes an error message so the id is not the cause
string rewarded_video_ad = “xxxxxx”;
bool testMode = true;
public bool adfinished = false;
public bool adReady = false;
private void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
}
else { Destroy(gameObject);}
}
void Start()
{
textDebug.tdInst.addSub("ads_Start");
Advertisement.AddListener(this);
textDebug.tdInst.addSub("ads_addListener");
Advertisement.Initialize((string)store_id, testMode);
textDebug.tdInst.addSub("ads_init");
}
public void OnUnityAdsReady(string placementId)
{
textDebug.tdInst.addSub("adsReady_test"); // never appear on mobile so advertisement seems to be crashed
if (placementId == rewarded_video_ad)
{
adReady = true;
textDebug.tdInst.addSub("adsReady_true"); // appeear on PC after 3 attempts (test) before returning true
}
}