From 1bd5ea0238ad173d4faa8a947e87061944764e64 Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Fri, 9 Aug 2024 09:41:19 -0700 Subject: [PATCH] Updates for RestoreAsync --- src/Plugin.InAppBilling/InAppBilling.ios.cs | 5 +++-- src/Plugin.InAppBilling/InAppBilling.maccatalyst.cs | 5 +++-- src/Plugin.InAppBilling/InAppBilling.macos.cs | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Plugin.InAppBilling/InAppBilling.ios.cs b/src/Plugin.InAppBilling/InAppBilling.ios.cs index 98b1201..d891880 100644 --- a/src/Plugin.InAppBilling/InAppBilling.ios.cs +++ b/src/Plugin.InAppBilling/InAppBilling.ios.cs @@ -244,7 +244,7 @@ public async override Task> GetPurchasesAsync( - Task RestoreAsync(CancellationToken cancellationToken) + async Task RestoreAsync(CancellationToken cancellationToken) { var tcsTransaction = new TaskCompletionSource(); @@ -283,7 +283,8 @@ Task RestoreAsync(CancellationToken cancellationToken) // Start receiving restored transactions SKPaymentQueue.DefaultQueue.RestoreCompletedTransactions(); - return tcsTransaction.Task; + var result = await tcsTransaction.Task; + return result; } finally { diff --git a/src/Plugin.InAppBilling/InAppBilling.maccatalyst.cs b/src/Plugin.InAppBilling/InAppBilling.maccatalyst.cs index 98b1201..dc6b1bd 100644 --- a/src/Plugin.InAppBilling/InAppBilling.maccatalyst.cs +++ b/src/Plugin.InAppBilling/InAppBilling.maccatalyst.cs @@ -244,7 +244,7 @@ public async override Task> GetPurchasesAsync( - Task RestoreAsync(CancellationToken cancellationToken) + async Task RestoreAsync(CancellationToken cancellationToken) { var tcsTransaction = new TaskCompletionSource(); @@ -283,7 +283,8 @@ Task RestoreAsync(CancellationToken cancellationToken) // Start receiving restored transactions SKPaymentQueue.DefaultQueue.RestoreCompletedTransactions(); - return tcsTransaction.Task; + var result = await tcsTransaction.Task; + return result; } finally { diff --git a/src/Plugin.InAppBilling/InAppBilling.macos.cs b/src/Plugin.InAppBilling/InAppBilling.macos.cs index 98b1201..dc6b1bd 100644 --- a/src/Plugin.InAppBilling/InAppBilling.macos.cs +++ b/src/Plugin.InAppBilling/InAppBilling.macos.cs @@ -244,7 +244,7 @@ public async override Task> GetPurchasesAsync( - Task RestoreAsync(CancellationToken cancellationToken) + async Task RestoreAsync(CancellationToken cancellationToken) { var tcsTransaction = new TaskCompletionSource(); @@ -283,7 +283,8 @@ Task RestoreAsync(CancellationToken cancellationToken) // Start receiving restored transactions SKPaymentQueue.DefaultQueue.RestoreCompletedTransactions(); - return tcsTransaction.Task; + var result = await tcsTransaction.Task; + return result; } finally {