|
- using System;
-
- namespace CI.WSANative.Advertising
- {
- public static class WSANativeInterstitialAd
- {
- public static Action<WSAInterstitialAdType> AdReady { get; set; }
-
- public static Action<WSAInterstitialAdType> Cancelled { get; set; }
-
- public static Action<WSAInterstitialAdType> Completed { get; set; }
-
- public static Action<WSAInterstitialAdType, string> ErrorOccurred { get; set; }
-
- public static void Initialise(WSAInterstitialAdType adType, string appId, string adUnitId)
- {
- if (adType != WSAInterstitialAdType.AdDuplex)
- {
- if (adType != WSAInterstitialAdType.Microsoft)
- {
- if (adType == WSAInterstitialAdType.Vungle)
- {
- WSANativeInterstitialAd._vungleAppId = appId;
- }
- }
- else
- {
- WSANativeInterstitialAd._msAppId = appId;
- WSANativeInterstitialAd._msAdUnitId = adUnitId;
- }
- }
- else
- {
- WSANativeInterstitialAd._adDuplexAppId = appId;
- WSANativeInterstitialAd._adDuplexAdUnitId = adUnitId;
- }
- }
-
- public static void RequestAd(WSAInterstitialAdType adType)
- {
- if (WSANativeInterstitialAd._Request != null)
- {
- if (adType != WSAInterstitialAdType.AdDuplex)
- {
- if (adType != WSAInterstitialAdType.Microsoft)
- {
- if (adType == WSAInterstitialAdType.Vungle)
- {
- WSANativeInterstitialAd._Request(adType, WSANativeInterstitialAd._vungleAppId, string.Empty);
- }
- }
- else
- {
- WSANativeInterstitialAd._Request(adType, WSANativeInterstitialAd._msAppId, WSANativeInterstitialAd._msAdUnitId);
- }
- }
- else
- {
- WSANativeInterstitialAd._Request(adType, WSANativeInterstitialAd._adDuplexAppId, WSANativeInterstitialAd._adDuplexAdUnitId);
- }
- }
- }
-
- public static void ShowAd(WSAInterstitialAdType adType)
- {
- if (WSANativeInterstitialAd._Show != null)
- {
- WSANativeInterstitialAd._Show(adType);
- }
- }
-
- public static Action<WSAInterstitialAdType, string, string> _Request;
-
- public static Action<WSAInterstitialAdType> _Show;
-
- private static string _adDuplexAppId;
-
- private static string _adDuplexAdUnitId;
-
- private static string _msAppId;
-
- private static string _msAdUnitId;
-
- private static string _vungleAppId;
- }
- }
|