Example #1
0
        /// <summary>
        /// Get Purchases with the status information
        /// </summary>
        /// <param name="itemType"></param>
        /// <returns></returns>
        public async Task <List <PurchaseResult> > GetPurchaseHistoryAsync(ItemType itemType)
        {
            if (BillingClient == null || !BillingClient.IsReady)
            {
                await ConnectAsync();
            }

            _tcsPurchaseHistory = new TaskCompletionSource <List <PurchaseResult> >();

            var type = itemType == ItemType.InAppPurchase ? BillingClient.SkuType.Inapp : BillingClient.SkuType.Subs;

            BillingClient.QueryPurchaseHistoryAsync(type, this);

            return(await _tcsPurchaseHistory?.Task ?? default);
        }