From 16fd940a5fe4207faaccdd3986521c0a1517bc41 Mon Sep 17 00:00:00 2001 From: JPZV <38300410+JPZV@users.noreply.github.com> Date: Tue, 21 Dec 2021 15:42:01 -0300 Subject: [PATCH] Fixed deprecated warning from SKPayment.CreateFrom(string) (Issue #432) --- src/Plugin.InAppBilling/InAppBilling.apple.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Plugin.InAppBilling/InAppBilling.apple.cs b/src/Plugin.InAppBilling/InAppBilling.apple.cs index 272fea5..4869058 100644 --- a/src/Plugin.InAppBilling/InAppBilling.apple.cs +++ b/src/Plugin.InAppBilling/InAppBilling.apple.cs @@ -289,11 +289,6 @@ async Task PurchaseAsync(string productId) paymentObserver.TransactionCompleted += handler; -#if __IOS__ || __TVOS__ - - var payment = SKPayment.CreateFrom(productId); -#else - var products = await GetProductAsync(new[] { productId }); var product = products?.FirstOrDefault(); if (product == null) @@ -301,7 +296,7 @@ async Task PurchaseAsync(string productId) var payment = SKPayment.CreateFrom(product); //var payment = SKPayment.CreateFrom((SKProduct)SKProduct.FromObject(new NSString(productId))); -#endif + SKPaymentQueue.DefaultQueue.AddPayment(payment); return await tcsTransaction.Task;