From d6f7bd4b5a8bb12190fb234efe817f47d0a66736 Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Sat, 19 Sep 2020 10:56:27 -0700 Subject: [PATCH] Update README.md --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a495045..b6e973c 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,19 @@ I co-host a weekly development podcast, [Merge Conflict](http://mergeconflict.fm ## Version 4 Major Update - Android +We now use Xamarin.Essentials for getting access to the current activity. So ensure you initialize Xamarin.Essentials in your Android app. + +Also if you get a null exception the linker is being aggressive so write the following code in your MainActivity: + +```csharp +var context = Platform.AppContext; +var activity = Platform.CurrentActivity; +``` + Version 4.X updates to the new Android billing client. This means there are few important changes: -1.) You must acknowledge all purchases within 3 days, by calling `AcknowledgePurchaseAsync` or the Consume API if it a consumable. -2.) You must hanle Pending Transactions from outside of you app. See [docs from Google](https://developer.android.com/google/play/billing/integrate#pending) -3.) `HandleActivityResult` is removed from the API as it is not needed +1. You must acknowledge all purchases within 3 days, by calling `AcknowledgePurchaseAsync` or the Consume API if it a consumable. +2. You must hanle Pending Transactions from outside of you app. See [docs from Google](https://developer.android.com/google/play/billing/integrate#pending) +3. `HandleActivityResult` is removed from the API as it is not needed ### Pending Transactions: * If the result of PurchaseAsync is PurchaseState.PaymentPending, store the order details locally and inform the user that they will have access to the product when the payment completes