1

I have developed an app. In which, to access level a player needs to purchase or watch rewarded video. To watch a rewarded video player needs to press or tap a button. but when i press a button, nothing is happening!!

I have created a file "AdManager.cs" and the code is as follows:

    public class AdManager : MonoBehaviour {
    // before codes
    .
    .
    .
    //I have created an instance to admanager
    public static AdManager Instance {set;get;}
    .
    .
    .
    .
    void Awake(){
    Instance=this;
    }
    .
.
.
.
    //few more codes
.
.
.
    public void showRewardBasedVideoAd(){
        #if UNITY_ANDROID
        string adUnitId = "xxxxxxxxxxxxxxxxxxxxxxx";
        #elif UNITY_IPHONE
        string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
        #else
        string adUnitId = "unexpected_platform";
        #endif
        rewardBasedVideoAd = RewardBasedVideoAd.Instance;

        rewardBasedVideoAd.OnAdLoaded += HandleOnrewardBasedVideoAdLoaded;

        rewardBasedVideoAd.OnAdFailedToLoad +=     HandleOnrewardBasedVideoAdFailedToLoad;

        rewardBasedVideoAd.OnAdOpening += HandleOnrewardBasedVideoAdOpening;

        rewardBasedVideoAd.OnAdRewarded += HandleOnrewardBasedVideoAdRewarded;
        rewardBasedVideoAd.OnAdClosed += HandleOnrewardBasedVideoAdClosed;

        rewardBasedVideoAd.OnAdLeavingApplication += HandleOnrewardBasedVideoAdLeavingApplication;

        AdRequest request = new AdRequest.Builder ().Build();
        rewardBasedVideoAd.LoadAd (request, adUnitId);

        if (rewardBasedVideoAd.IsLoaded ()) {
        rewardBasedVideoAd.Show ();
        } else {
        Debug.Log ("Rewarded Video Ad is not Yet ready!!!!");
        }
        }

        public void HandleOnrewardBasedVideoAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
        {
        print("Interstitial Failed to load: " + args.Message);

        }
        public void HandleOnrewardBasedVideoAdLoaded(object sender, EventArgs args)
        {
        print("OnAdLoaded event received.");

        }
        public void HandleOnrewardBasedVideoAdOpening(object sender, EventArgs args)
        {
        print("OnAdLoaded event received.");

        }
        public void HandleOnrewardBasedVideoAdClosed(object sender, EventArgs args)
        {
        print("OnAdLoaded event received.");

        }
        public void HandleOnrewardBasedVideoAdLeavingApplication(object sender, EventArgs args)
        {
        print("OnAdLoaded event received.");

        }
        public void HandleOnrewardBasedVideoAdRewarded(object sender, Reward args)
        {
        string type = args.Type;
        double amount = args.Amount;
        print("User rewarded with: " + amount.ToString() + " " + type);
        totalPoints += 100;
        Debug.Log("100granted");
        }
     // rest codes
    }

I am developing this app in unity and for android platform. I have created unityad mediation in admob rewarded video adunit section. There is mark which is saying pending. I could not able to figure out where is the problem.

Guide me in this regard!!

Kumar Babu
  • 25
  • 6

1 Answers1

0

If you are using only one network to show rewarded video you can simply use Unity ADS SDK without any medation. I had same problem and after few months I gave up. I used Admob for banners/interstitials and UnityAds for rewarded Video and it's working great.

  • Yeah dude. I did same thing. I also gave up on admob rewarded and using interstitial / banner from admob and reward video from unity. – Kumar Babu Oct 28 '16 at 13:26