Ad Manager

Hello,

For some reason I cannot implement the AdMAnager correctly.
The line " Advertisement.AddListener(this);" is giving me an error.
The error: cannot convert from ‘AdManager’ to ‘UnityEngine.Advertisement.IUnityadsListener’

Can anybody please help me

public class AdManager : MonoBehaviour, IUnityAdsListener
{
public static AdManager instance;   

 private void Start()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
            Advertisement.AddListener(this);       
            Advertisement.Initialize(storeID, testMode);
        }
        else
        {
            Destroy(gameObject);
        }
    }
}

Hi,
you need to add IUnityAdsListener like this -

public void OnUnityAdsDidFinish (string placementId, ShowResult showResult) 
{
    // Define conditional logic for each ad completion status:
    switch(showResult)
    {
        case ShowResult.Finished:
            // Reward the user for watching the ad to completion.
            break;

        case ShowResult.Skipped:
            // Do not reward the user for skipping the ad.
            break;

        case ShowResult.Failed:
            Debug.LogWarning (“The ad did not finish due to an error.);
            break;
    }
}

public void OnUnityAdsReady (string placementId) 
{
    if (placementId != myPlacementId) return;

    adsAreReady = true;
}

public void OnUnityAdsDidError (string message) 
{
    // Log the error.
}

public void OnUnityAdsDidStart (string placementId) 
{
    // Optional actions to take when the end-users triggers an ad.
}