Ejemplo n.º 1
0
        private void ObtainOwnedPurchaseRecord(OwnedPurchasesReq req)
        {
            ITask <OwnedPurchasesResult> task = iapClient.ObtainOwnedPurchaseRecord(req);

            task.AddOnSuccessListener((result) =>
            {
                Debug.Log("HMSP: ObtainOwnedPurchaseRecord");
                foreach (var item in result.InAppPurchaseDataList)
                {
                    Debug.Log("[HMSPlugin]: ProductId: " + item.ProductId + ", ProductName: " + item.ProductName + ", Price: " + item.Price);
                }
                OnObtainOwnedPurchaseRecordSuccess?.Invoke(result);
            }).AddOnFailureListener((exception) =>
            {
                Debug.Log("HMSP: Error on ObtainOwnedPurchaseRecord");
                OnObtainOwnedPurchaseRecordFailure?.Invoke(exception);
            });
        }
Ejemplo n.º 2
0
        public void ObtainOwnedPurchaseRecord()
        {
            if (iapAvailable != true)
            {
                OnObtainOwnedPurchaseRecordFailure?.Invoke(IAP_NOT_AVAILABLE);
                return;
            }

            Debug.Log("HMSP: ObtainOwnedPurchaseRecord");
            ObtainOwnedPurchaseRecord(new OwnedPurchasesReq()
            {
                PriceType = PriceType.IN_APP_CONSUMABLE
            });
            ObtainOwnedPurchaseRecord(new OwnedPurchasesReq()
            {
                PriceType = PriceType.IN_APP_NONCONSUMABLE
            });
            ObtainOwnedPurchaseRecord(new OwnedPurchasesReq()
            {
                PriceType = PriceType.IN_APP_SUBSCRIPTION
            });
        }