From 90fb46fec5f014f3fb893ebef448064d9efe6ded Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Tue, 3 May 2022 18:28:57 -0700 Subject: [PATCH] Update to FinalizePurchaseAsync --- docs/PurchaseNonConsumable.md | 4 ++-- docs/PurchaseSubscription.md | 4 ++-- nuget/readme.txt | 4 ++-- src/Plugin.InAppBilling/InAppBilling.android.cs | 2 +- src/Plugin.InAppBilling/InAppBilling.apple.cs | 4 ++-- src/Plugin.InAppBilling/Shared/BaseInAppBilling.shared.cs | 2 +- src/Plugin.InAppBilling/Shared/IInAppBilling.shared.cs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/PurchaseNonConsumable.md b/docs/PurchaseNonConsumable.md index d524df6..fbf2312 100644 --- a/docs/PurchaseNonConsumable.md +++ b/docs/PurchaseNonConsumable.md @@ -21,7 +21,7 @@ All purchases go through the `PurchaseAsync` method and you must always `Connect Task PurchaseAsync(string productId, ItemType itemType, IInAppBillingVerifyPurchase verifyPurchase = null); ``` -On Android you must call `FinalizeAndAcknowlegeAsync` within 3 days when a purchase is validated. Please read the [Android documentation on Pending Transactions](https://developer.android.com/google/play/billing/integrate#pending) for more information. +On Android you must call `FinalizePurchaseAsync` within 3 days when a purchase is validated. Please read the [Android documentation on Pending Transactions](https://developer.android.com/google/play/billing/integrate#pending) for more information. On iOS you must also call @@ -49,7 +49,7 @@ public async Task PurchaseItem(string productId) } else if(purchase.State == PurchaseState.Purchased) { - var ack = await CrossInAppBilling.Current.FinalizeAndAcknowlegeAsync(purchase.TransactionIdentifier); + var ack = await CrossInAppBilling.Current.FinalizePurchaseAsync(purchase.TransactionIdentifier); // Handle if acknowledge was successful or not } diff --git a/docs/PurchaseSubscription.md b/docs/PurchaseSubscription.md index 6332350..bc70868 100644 --- a/docs/PurchaseSubscription.md +++ b/docs/PurchaseSubscription.md @@ -23,7 +23,7 @@ All purchases go through the `PurchaseAsync` method and you must always `Connect Task PurchaseAsync(string productId, ItemType itemType, IInAppBillingVerifyPurchase verifyPurchase = null, string obfuscatedAccountId = null, string obfuscatedProfileId = null); ``` -On Android you must call `FinalizeAndAcknowlegeAsync` within 3 days when a purchase is validated. Please read the [Android documentation on Pending Transactions](https://developer.android.com/google/play/billing/integrate#pending) for more information. +On Android you must call `FinalizePurchaseAsync` within 3 days when a purchase is validated. Please read the [Android documentation on Pending Transactions](https://developer.android.com/google/play/billing/integrate#pending) for more information. You must also call this on iOS to finalize and acknowlege the transation. @@ -52,7 +52,7 @@ public async Task PurchaseItem(string productId, string payload) } else if(purchase.State == PurchaseState.Purchased) { - var ack = await CrossInAppBilling.Current.FinalizeAndAcknowlegeAsync(purchase.TransactionIdentifier); + var ack = await CrossInAppBilling.Current.FinalizePurchaseAsync(purchase.TransactionIdentifier); // Handle if acknowledge was successful or not } diff --git a/nuget/readme.txt b/nuget/readme.txt index 3685cc5..485b132 100644 --- a/nuget/readme.txt +++ b/nuget/readme.txt @@ -4,12 +4,12 @@ Version 5.0+ has more significant updates! 1.) We have removed IInAppBillingVerifyPurchase from all methods. All data required to handle this yourself is returned. 2.) iOS ReceiptURL data is avaialble via ReceiptData 3.) We are now using Android Billing version 4 -4.) SUPER IMPORTANT: iOS has changed the way in which in-app purchases are handled. They are no longer automatically finished and you must call `FinalizeAndAcknowlegeAsync(string transactionIdentifier)` on each transaction! +4.) SUPER IMPORTANT: iOS has changed the way in which in-app purchases are handled. They are no longer automatically finished and you must call `FinalizePurchaseAsync(string transactionIdentifier)` on each transaction! Version 4.0 has significant updates. 1.) You must compile and target against Android 10 or higher -2.) On Android you must handle pending transactions and call `FinalizeAndAcknowlegeAsync` when done +2.) On Android you must handle pending transactions and call `FinalizePurchaseAsync` when done 3.) On Android HandleActivityResult has been removed. 4.) We now use Xamarin.Essentials and setup is required per docs. diff --git a/src/Plugin.InAppBilling/InAppBilling.android.cs b/src/Plugin.InAppBilling/InAppBilling.android.cs index c6b5f5e..c26dcb4 100644 --- a/src/Plugin.InAppBilling/InAppBilling.android.cs +++ b/src/Plugin.InAppBilling/InAppBilling.android.cs @@ -381,7 +381,7 @@ async Task PurchaseAsync(string productSku, string itemTyp } - public async override Task FinalizeAndAcknowlegeAsync(string transactionIdentifier) + public async override Task FinalizePurchaseAsync(string transactionIdentifier) { if (BillingClient == null || !IsConnected) throw new InAppBillingPurchaseException(PurchaseError.ServiceUnavailable, "You are not connected to the Google Play App store."); diff --git a/src/Plugin.InAppBilling/InAppBilling.apple.cs b/src/Plugin.InAppBilling/InAppBilling.apple.cs index 6f3d578..d549685 100644 --- a/src/Plugin.InAppBilling/InAppBilling.apple.cs +++ b/src/Plugin.InAppBilling/InAppBilling.apple.cs @@ -438,7 +438,7 @@ public override string ReceiptData /// If consumed successful /// If an error occurs during processing public override Task ConsumePurchaseAsync(string productId, string transactionIdentifier) => - FinalizeAndAcknowlegeAsync(transactionIdentifier); + FinalizePurchaseAsync(transactionIdentifier); /// /// Finish a transaction manually @@ -446,7 +446,7 @@ public override string ReceiptData /// /// /// - public async override Task FinalizeAndAcknowlegeAsync(string transactionIdentifier) + public async override Task FinalizePurchaseAsync(string transactionIdentifier) { if (string.IsNullOrWhiteSpace(transactionIdentifier)) throw new ArgumentException("Purchase Token must be valid", nameof(transactionIdentifier)); diff --git a/src/Plugin.InAppBilling/Shared/BaseInAppBilling.shared.cs b/src/Plugin.InAppBilling/Shared/BaseInAppBilling.shared.cs index 844eac6..876365a 100644 --- a/src/Plugin.InAppBilling/Shared/BaseInAppBilling.shared.cs +++ b/src/Plugin.InAppBilling/Shared/BaseInAppBilling.shared.cs @@ -143,7 +143,7 @@ public virtual void Dispose(bool disposing) /// /// /// - public virtual Task FinalizeAndAcknowlegeAsync(string transactionIdentifier) => Task.FromResult(true); + public virtual Task FinalizePurchaseAsync(string transactionIdentifier) => Task.FromResult(true); /// /// iOS: Displays a sheet that enables users to redeem subscription offer codes that you configure in App Store Connect. diff --git a/src/Plugin.InAppBilling/Shared/IInAppBilling.shared.cs b/src/Plugin.InAppBilling/Shared/IInAppBilling.shared.cs index f957825..918e41d 100644 --- a/src/Plugin.InAppBilling/Shared/IInAppBilling.shared.cs +++ b/src/Plugin.InAppBilling/Shared/IInAppBilling.shared.cs @@ -31,7 +31,7 @@ public interface IInAppBilling : IDisposable /// /// /// - Task FinalizeAndAcknowlegeAsync(string transactionIdentifier); + Task FinalizePurchaseAsync(string transactionIdentifier); /// /// Connect to billing service