src/ApprienUnitySDK/Assets/Apprien/Scripts/Apprien.cs
/// <summary>
/// Tell Apprien that these products were shown. NOTE: This is needed for Apprien to work correctly.
/// </summary>
/// <param name="apprienProducts"></param>
/// <returns>Returns an IEnumerator that can be forwarded manually or passed to StartCoroutine.</returns>
Tell Apprien that these products were shown. NOTE: This is needed for Apprien to work correctly.
Tell Apprien that these products were shown . NOTE : This is needed for Apprien to work correctly .
public IEnumerator ProductsShown(ApprienProduct[] apprienProducts)
        {
            var formData = new List<IMultipartFormSection>();
            for (var i = 0; i < apprienProducts.Length; i++)
            {
                formData.Add(new MultipartFormDataSection("iap_ids[" + i + "]", apprienProducts[i].ApprienVariantIAPId));
            }
            var url = String.Format(ApprienUtility.REST_POST_PRODUCTS_SHOWN_URL, StoreIdentifier);
            using(var request = UnityWebRequest.Post(url, formData))
            {
                request.SetRequestHeader("Authorization", "Bearer " + Token);
                yield return ApprienUtility.SendWebRequest(request);
                if (ApprienUtility.IsHttpError(request))
                {
                    SendError((int) request.responseCode, "Error occured while posting products shown. HTTP error: " + request.downloadHandler.text);
                }
                else if (ApprienUtility.IsNetworkError(request))
                {
                    SendError((int) request.responseCode, "Error occured while posting products shown. Network error");
                }
            }
        }
public IEnumerator ProductsShown ( ApprienProduct [ ] apprienProducts ) { var formData = new List < IMultipartFormSection > ( ) ; for ( var i = 0 ; i < apprienProducts . Length ; i ++ ) { formData . Add ( new MultipartFormDataSection ( " " + i + " " , apprienProducts [ i ] . ApprienVariantIAPId ) ) ; } var url = String . Format ( ApprienUtility . REST_POST_PRODUCTS_SHOWN_URL , StoreIdentifier ) ; using ( var request = UnityWebRequest . Post ( url , formData ) ) { request . SetRequestHeader ( " " , " " + Token ) ; yield return ApprienUtility . SendWebRequest ( request ) ; if ( ApprienUtility . IsHttpError ( request ) ) { SendError ( ( int ) request . responseCode , " " + request . downloadHandler . text ) ; } else if ( ApprienUtility . IsNetworkError ( request ) ) { SendError ( ( int ) request . responseCode , " " ) ; } } }
Tell Apprien that these products were shown.
Tell Apprien that these products were shown .
Returns an IEnumerator that can be forwarded manually or passed to StartCoroutine.
Returns an IEnumerator that can be forwarded manually or passed to StartCoroutine .
apprienProducts
ApprienProduct[]
None