/// <summary> /// Attempts to show an ad from Chartboost for the given CBLocation. /// </summary> public static void ChartboostShowForLocation(string location) { #if UNITY_ANDROID HZInterstitialAdAndroid.chartboostShowForLocation(location); #elif UNITY_IPHONE && !UNITY_EDITOR HZInterstitialAdIOS.chartboostShowForLocation(location); #else #endif }
/// <summary> /// Returns whether an ad is available at the given CBLocation. /// </summary> public static bool ChartboostIsAvailableForLocation(string location) { #if UNITY_ANDROID return(HZInterstitialAdAndroid.chartboostIsAvailableForLocation(location)); #elif UNITY_IPHONE && !UNITY_EDITOR return(HZInterstitialAdIOS.chartboostIsAvailableForLocation(location)); #else return(false); #endif }
/// <summary> /// Returns whether or not an ad is available. /// </summary> /// <returns><c>true</c>, if an ad is available, <c>false</c> otherwise.</returns> public static bool IsAvailable() { #if UNITY_ANDROID return(HZInterstitialAdAndroid.IsAvailable()); #elif UNITY_IPHONE && !UNITY_EDITOR return(HZInterstitialAdIOS.IsAvailable()); #else return(false); #endif }
/// <summary> /// Fetches an ad /// </summary> public static void Fetch() { #if UNITY_ANDROID HZInterstitialAdAndroid.Fetch(); #endif #if UNITY_IPHONE && !UNITY_EDITOR HZInterstitialAdIOS.Fetch(); #endif }
/// <summary> /// Fetches an ad from Chartboost for the given CBLocation. /// </summary> public static void ChartboostFetchForLocation(string location) { #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE) #if UNITY_ANDROID HZInterstitialAdAndroid.chartboostFetchForLocation(location); #elif UNITY_IPHONE HZInterstitialAdIOS.chartboostFetchForLocation(location); #endif #else #endif }
/// <summary> /// Fetches an ad for the given ad tag. /// </summary> /// <param name="tag">The ad tag to fetch an ad for.</param> public static void Fetch(string tag) { tag = HeyzapAds.TagForString(tag); #if UNITY_ANDROID HZInterstitialAdAndroid.Fetch(tag); #endif #if UNITY_IPHONE && !UNITY_EDITOR HZInterstitialAdIOS.Fetch(tag); #endif }
/// <summary> /// Returns whether or not an ad is available for the given ad tag. /// </summary> /// <returns><c>true</c>, if an ad is available, <c>false</c> otherwise.</returns> public static bool IsAvailable(string tag) { tag = HeyzapAds.TagForString(tag); #if UNITY_ANDROID return(HZInterstitialAdAndroid.IsAvailable(tag)); #elif UNITY_IPHONE && !UNITY_EDITOR return(HZInterstitialAdIOS.IsAvailable(tag)); #else return(false); #endif }
/// <summary> /// Fetches an ad for the given ad tag. /// </summary> /// <param name="tag">The ad tag to fetch an ad for.</param> public static void Fetch(string tag) { tag = HeyzapAds.TagForString(tag); #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE) #if UNITY_ANDROID HZInterstitialAdAndroid.Fetch(tag); #elif UNITY_IPHONE HZInterstitialAdIOS.Fetch(tag); #endif #else UnityEngine.Debug.LogWarning("Call received to fetch an HZInterstitialAd, but the SDK does not function in the editor. You must use a device/emulator to fetch/show ads."); _instance.StartCoroutine(InvokeCallbackNextFrame(HeyzapAds.NetworkCallback.FETCH_FAILED, tag)); #endif }
/// <summary> /// Shows an ad with the given options. /// </summary> /// <param name="showOptions"> The options to show the ad with, or the default options if <c>null</c></param> public static void ShowWithOptions(HZShowOptions showOptions) { if (showOptions == null) { showOptions = new HZShowOptions(); } #if UNITY_ANDROID HZInterstitialAdAndroid.ShowWithOptions(showOptions); #endif #if UNITY_IPHONE && !UNITY_EDITOR HZInterstitialAdIOS.ShowWithOptions(showOptions); #endif }
/// <summary> /// Shows an ad with the given options. /// </summary> /// <param name="showOptions"> The options to show the ad with, or the default options if <c>null</c></param> public static void ShowWithOptions(HZShowOptions showOptions) { if (showOptions == null) { showOptions = new HZShowOptions(); } #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE) #if UNITY_ANDROID HZInterstitialAdAndroid.ShowWithOptions(showOptions); #elif UNITY_IPHONE HZInterstitialAdIOS.ShowWithOptions(showOptions); #endif #else UnityEngine.Debug.LogWarning("Call received to show an HZInterstitalAd, but the SDK does not function in the editor. You must use a device/emulator to fetch/show ads."); _instance.StartCoroutine(InvokeCallbackNextFrame(HeyzapAds.NetworkCallback.SHOW_FAILED, showOptions.Tag)); #endif }