Пример #1
0
        /// <summary>
        /// Simplified product registration by the product identifier.
        /// You can also define products using editor plugin settings: Stan's Assets->IOS Native->Edit Settings
        /// </summary>
        /// <param name="productId">Product identifier.</param>
        public static void RegisterProductId(string productId)
        {
            ISN_SKProduct tpl = new ISN_SKProduct();

            tpl.ProductIdentifier = productId;
            RegisterProduct(tpl);
        }
        public ISN_SKPaymentTransaction(ISN_SKProduct product, ISN_SKPaymentTransactionState state)
        {
            m_productIdentifier     = product.ProductIdentifier;
            m_transactionIdentifier = SA_IdFactory.RandomString;
            m_unixDate = SA_Unix_Time.ToUnixTime(DateTime.UtcNow);

            m_state = state;
        }
Пример #3
0
        private static void CacheAppStoreProducts(ISN_SKInitResult result)
        {
            m_products.Clear();
            foreach (ISN_SKProduct product in result.Products)
            {
                ISN_SKProduct settingsProduct = GetProductFromSettings(product.ProductIdentifier);
                if (settingsProduct != null)
                {
                    product.EditorData = settingsProduct.EditorData;
                }

                m_products.Add(product.ProductIdentifier, product);
            }
        }
Пример #4
0
        /// <summary>
        /// Registers the product.
        /// You can also define products using editor plugin settings: Stan's Assets->IOS Native->Edit Settings
        /// </summary>
        /// <param name="product">Product.</param>
        public static void RegisterProduct(ISN_SKProduct product)
        {
            bool IsProductAlreadyInList = false;
            int  replaceIndex           = 0;

            foreach (ISN_SKProduct p in ISN_Settings.Instance.InAppProducts)
            {
                if (p.ProductIdentifier.Equals(product.ProductIdentifier))
                {
                    IsProductAlreadyInList = true;
                    replaceIndex           = ISN_Settings.Instance.InAppProducts.IndexOf(p);
                    break;
                }
            }

            if (IsProductAlreadyInList)
            {
                ISN_Settings.Instance.InAppProducts[replaceIndex] = product;
            }
            else
            {
                ISN_Settings.Instance.InAppProducts.Add(product);
            }
        }