I'm developing a mobile (android) game in unity and I've decided to add ADS. My rewarded ads is not rewarding after being build on my phone. it works completely fine in my unity engine but after I build it on my phone rewarded ad works but when I cross it after the ad is completed the reward is not given. I checked my placement ID and game id ,everything looked 100% correct .Here is my code.
//Start is called before the first frame update
void Start()
{
le = GameObject.Find("trig");
Advertisement.Initialize(googleplayid, testMode);
Advertisement.AddListener(this);
}
// Update is called once per frame
void Update()
{
if (Input.GetKey("k"))
{
DisplayInterstitialAD();
}
}
public void DisplayInterstitialAD()
{
int rn = Random.Range(0, 5);
if (rn == 1)
{
Advertisement.Show();
}
}
public void playrewardedAD()
{
if (Advertisement.IsReady(rewarid))
{
Advertisement.Show(rewarid);
}
else
{
Debug.Log("not rady");
}
}
public void OnUnityAdsReady(string placementId)
{
Debug.Log("ADS ARE READY!");
}
public void OnUnityAdsDidError(string message)
{
Debug.Log("ERROR:"+ message);
}
public void OnUnityAdsDidStart(string placementId)
{
Debug.Log("VIDEO STARTED");
}
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
{
if (placementId == rewarid)
{
if (showResult == ShowResult.Finished)
{
Debug.Log("we smell sucess");
sucess(le);
}
}
}
void sucess(GameObject le)
{
lo.GetComponent().CUNTUNEaf();
le.GetComponent().cont();
}
↧