/// <summary> /// Initialize the interstitial ad and request the first ad /// </summary> /// <param name="appId">Microsoft Advertising application Id (set up in pubcenter)</param> /// <param name="unitId">Microsoft Advertising interstitial video ad id (set up in pubcenter)</param> public static void Init(string appId, string unitId) { Utils.RunOnWindowsUIThread(() => { DebugLog.Log(LogLevel.Info, "Initializing interstitial ads..."); interstitialAd = new InterstitialAd(); interstitialAd.AdReady += InterstitialAd_AdReady; interstitialAd.ErrorOccurred += InterstitialAd_ErrorOccurred; interstitialAd.Completed += InterstitialAd_Completed; interstitialAd.Cancelled += InterstitialAd_Cancelled; if (interstitialAd != null) { adAppId = appId; adUnitId = unitId; // automatically request the first ad DebugLog.Log(LogLevel.Info, "Requesting interstitial ads..."); interstitialAd.RequestAd(AdType.Video, adAppId, adUnitId); isAdRequested = true; } }); }
public IInterstittialAd CreateAd( Action<object> readyCallback, Action<object> completedCallback, Action<object> cancelledCallback, Action<object> errorCallback) { InterstitialAd ad = new InterstitialAd ( readyCallback, completedCallback, cancelledCallback , errorCallback ); return ad; }
public IInterstittialAd CreateAd(Action <object> readyCallback, Action <object> completedCallback, Action <object> cancelledCallback, Action <object> errorCallback) { InterstitialAd ad = new InterstitialAd(readyCallback, completedCallback, cancelledCallback, errorCallback); return(ad); }