How to use unity rewarded ads?

I have trouble using the unity ads reward system. I want to make a game where if I press a button an ad will show and the player will get some points. I added at the OnClick parameter the function Ads.ShowRewardedAd. This is my script:

        public class UnityAdsExample : MonoBehaviour
          public void ShowRewardedAd()
            if (Advertisement.IsReady("rewardedVideo"))
              var options = new ShowOptions { resultCallback = HandleShowResult };
              Advertisement.Show("rewardedVideo", options);

          private void HandleShowResult(ShowResult result)
            switch (result)
              case ShowResult.Finished:
                Debug.Log("The ad was successfully shown.");
                // YOUR CODE TO REWARD THE GAMER
                // Give coins etc.
              case ShowResult.Skipped:
                Debug.Log("The ad was skipped before reaching the end.");
              case ShowResult.Failed:
                Debug.LogError("The ad failed to be shown.");

Download Admob Unity3d Plugin

Installation Admob Unity

Open your project in the Unity editor.
Navigate to Assets → Import Package → Custom Package.
Select the AdmobUnityPlugin.unitypackage file.
Import all of the files for the plugins by selecting Import. Make sure to check for any conflicts with files.

Init Admob Unity Plugin

Create A C# script ,drag the script to a object on scene , add the follow code in the script file

using admob;
Admob.Instance().initAdmob("admob banner id", "admob interstitial id");//admob id with format ca-app-pub-279xxxxxxxx/xxxxxxxx
//Admob.Instance().initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910");

Here is the minimal code to create an admob video.


Video need to be explicitly shown at an appropriate stopping point in your app, check that the video is ready before showing it:

if (Admob.Instance().isRewardedVideoReady()) {