/// <summary>
        /// Fetches an ad
        /// </summary>
        public static void Fetch()
        {
            #if UNITY_ANDROID
            HZIncentivizedAdAndroid.Fetch();
            #endif

            #if UNITY_IPHONE && !UNITY_EDITOR
            HZIncentivizedAdIOS.Fetch();
            #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(HZIncentivizedAdAndroid.IsAvailable());
     #elif UNITY_IPHONE && !UNITY_EDITOR
     return(HZIncentivizedAdIOS.IsAvailable());
     #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_ANDROID
            HZIncentivizedAdAndroid.Fetch(tag);
            #endif

            #if UNITY_IPHONE && !UNITY_EDITOR
            HZIncentivizedAdIOS.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(HZIncentivizedAdAndroid.IsAvailable(tag));
            #elif UNITY_IPHONE && !UNITY_EDITOR
            return(HZIncentivizedAdIOS.IsAvailable(tag));
            #else
            return(false);
            #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(HZIncentivizedShowOptions showOptions)
        {
            if (showOptions == null)
            {
                showOptions = new HZIncentivizedShowOptions();
            }

            #if UNITY_ANDROID
            HZIncentivizedAdAndroid.ShowWithOptions(showOptions);
            #endif

            #if UNITY_IPHONE && !UNITY_EDITOR
            HZIncentivizedAdIOS.ShowWithOptions(showOptions);
            #endif
        }
Exemple #6
0
        /// <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
            HZIncentivizedAdAndroid.Fetch(tag);
                #elif UNITY_IPHONE
            HZIncentivizedAdIOS.Fetch(tag);
                #endif
            #else
            UnityEngine.Debug.LogWarning("Call received to fetch an HZIncentivizedAd, 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
        }
Exemple #7
0
        /// <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(HZIncentivizedShowOptions showOptions)
        {
            if (showOptions == null)
            {
                showOptions = new HZIncentivizedShowOptions();
            }

            #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE)
                #if UNITY_ANDROID
            HZIncentivizedAdAndroid.ShowWithOptions(showOptions);
                #elif UNITY_IPHONE
            HZIncentivizedAdIOS.ShowWithOptions(showOptions);
                #endif
            #else
            UnityEngine.Debug.LogWarning("Call received to show an HZIncentivizedAd, 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
        }