Exemplo n.º 1
0
 /// <summary>
 /// Sends a request to the Virtual Currency Server to see if the user has earned virtual currency since the last request.
 /// The `VirtualCurrencyResponseListener` or the `VirtualCurrencyErrorListener` will receive the response once received.
 /// </summary>
 /// <param name="currencyId">The ID of the currency to request information about. Setting this to NULL will request the default currency.</param>
 public static void RequestDeltaOfCurrency(string currencyId)
 {
     #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE)
         #if UNITY_ANDROID
     HZOfferWallAdAndroid.RequestDeltaOfCurrency(currencyId);
         #elif UNITY_IPHONE
     HZOfferWallAdIOS.RequestDeltaOfCurrency(currencyId);
         #endif
     #else
     UnityEngine.Debug.LogWarning("Call received to request a VCS update on HZOfferWallAd, but the SDK does not function in the editor. You must use a device/emulator to do this.");
     _instance.StartCoroutine(InvokeVCSErrorNextFrame("only_works_on_device"));
     #endif
 }
Exemplo n.º 2
0
        /// <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_EDITOR && (UNITY_ANDROID || UNITY_IPHONE)
                #if UNITY_ANDROID
            return(HZOfferWallAdAndroid.IsAvailable(tag));
                #elif UNITY_IPHONE
            return(HZOfferWallAdIOS.IsAvailable(tag));
                #endif
            #else
            return(false);
            #endif
        }
Exemplo n.º 3
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
            HZOfferWallAdAndroid.Fetch(tag);
                #elif UNITY_IPHONE
            HZOfferWallAdIOS.Fetch(tag);
                #endif
            #else
            UnityEngine.Debug.LogWarning("Call received to fetch an HZOfferWallAd, 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
        }
Exemplo n.º 4
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(HZOfferWallShowOptions showOptions)
        {
            if (showOptions == null)
            {
                showOptions = new HZOfferWallShowOptions();
            }

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