- Home /
OnUnityAdsShowComplete not working
I took the code from integration guide for unity and ads are shown,I get the screen.For now I am just implementing rewarded ads and I executed it like this:
public void ShowAd()
{
// Disable the button:
// Then show the ad:
Advertisement.Show(_adUnitId, this);//string _adUnitId = "Rewarded_Android";
}//no problems in showing
The problem is here:
public void OnUnityAdsShowComplete(string placementId, UnityAdsShowCompletionState showCompletionState)
{
Debug.Log("Complete interface method executed");
if (showCompletionState.Equals(UnityAdsShowCompletionState.COMPLETED))
{
Debug.Log("Finished ad/reward");
videoFinishedDelegate?.Invoke();
}
else if (showCompletionState.Equals(UnityAdsShowCompletionState.SKIPPED))
{
Debug.Log(" not Finished ad/ no reward");
videoAdSkippedAction?.Invoke();
}
}
none of the debugs or delegates work whenever I press close in test screen. How do I fix it?
Answer by conguerror · Jul 25, 2021 at 09:49 AM
Unit answers has been helpful as always :)
So I switched to IUnityAdsListener interface(deleted others) and everything worked. Hope it helps someone.
I have added IUnityAdsListener interface and did what you said but still, OnUnityAdsDidFinish not being called on the editor I'm scared that the same problem happens on the Android do you have any idea that could help?
Answer by yaman3bd · Sep 16, 2021 at 10:26 AM
I fixed it you should use Advertisement.AddListener(this);
before you Initialize the Advertisement
Your answer
Follow this Question
Related Questions
Problem with 'AdsManager.UnityAdsShowVideo()' is deprecated 0 Answers
My already released iOS app only shows Unity placeholder ads :( 1 Answer
User-initiated ads VS click fraud 1 Answer
How can I add a microtransaction to my game that will disable ads for 24 hours? (C#) 0 Answers
UnityAds ECPM Question 0 Answers