How to call a method when "OnUnityAdsShowComplete" ?

Hello,

is there an easy way to migrate from Google Admobs to Unity ads ???

I’m trying to have handlers like this google admob way:

 this.rewardedAd.OnUserEarnedReward += HandleUserEarnedReward;

but this doesn’t work with unity ads and I don’t know how to implement it:

       this.RewardedAdsButton.OnUnityAdsShowComplete += HandleUserEarnedReward;

My method is:

public void HandleUserEarnedReward()
    {
        ShootRight.SetActive(true);
        ShootLeft.SetActive(true);
    }

How to call a method from another class when the user should be rewarded for interacting with the ad ?
Thank you in advance for your help.

Hi fobeaumer,

You can refer to this document. You need to implement “IUnityAdsShowListener” and add methods to “OnUnityAdsShowComplete” to realize your own functions.

1 Like