Show Result Unity ADS rewards
<p>When you pause the game, there is a button where you can click and view a non-skippable video at the end of this video. I want to implement the following:</p>

<p>If the video is watched to the end they gain 1 extra heart (max 3 full hearts) and get a chat box or alert dialog thanking.</p>

<p>If the video does not open, fully load or something goes wrong, they get nothing and a chat box or alert dialog appears.</p>

<p>Currently the video loads, But when the video ends, the prize is not received (1 extra heart), what is wrong in my code?</p>

<p>Below are the button ads</p>

<pre><code>using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
using UnityEngine.UI;

public class Ads : MonoBehaviour {

    public Button getAds;
    private Hearts heart;

    void OnEnable ()
    {
        getAds.onClick.AddListener (() =&gt; GetAds (getAds));
    }


    private void GetAds ( Button buttonPressed)
    {
        if (buttonPressed == getAds) {

            Advertisement.Initialize ("XXXXXX", true);
            Advertisement.IsReady ("rewardedVideo");
            Advertisement.Show ("rewardedVideo");
            }   
    }

    public void HandleShowResult (ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            heart = GameObject.FindGameObjectWithTag ("Hearts").GetComponent&lt;Hearts&gt; () as Hearts;
            heart.AddHeart ();
            break;

        case ShowResult.Skipped:
            Debug.Log("The ad was skipped before reaching the end.");
            break;

        case ShowResult.Failed:
            Debug.LogError("The ad failed to be shown.");
            break;
        }
    }


    void OnDisable ()
    {
        getAds.onClick.RemoveAllListeners ();
    }
}
</code></pre>

<p>Below current hearts system script</p>

<pre><code>using UnityEngine;
using System.Collections;

public class Hearts : MonoBehaviour {

    public Texture2D[]initialHeart;
    private int hearts;
    private int currentHearts;

    void Start () {

        GetComponent&lt;GUITexture&gt;().texture = initialHeart[0];
        hearts = initialHeart.Length;

    }

    void Update () {

    }

    public bool TakeHeart()
    {
        if (hearts &lt; 0) {

            return false;

        }

        if (currentHearts &lt; (hearts - 1)) {

            currentHearts += 1;
            GetComponent&lt;GUITexture&gt; ().texture = initialHeart [currentHearts];
            return true;


        } else {

            return false;

        }   
    }

    public bool AddHeart() {

        if (currentHearts &gt; 0) {
            currentHearts -= 1;
            GetComponent&lt;GUITexture&gt; ().texture = initialHeart [currentHearts];
            return true;
        } else {
            return false;

        }
    }
}
</code></pre>