From c5ba6e7011d79e1aa8d9172fdf1fb52b7bc17ed1 Mon Sep 17 00:00:00 2001 From: Margot Date: Mon, 28 Aug 2023 15:04:38 +0300 Subject: [PATCH] update docs --- CHANGELOG.md | 6 ++++++ README.md | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7294ba..dda495d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ # Versions +## v2.0.0 +* Update iOS PurchaseConnector to 6.12.2 +* Update Android PurchaseConnector to 2.0.0 +* Support for Google Play Billing Library 5.0 +* Callbacks format updated for more readability + ## v1.0.1 * Update iOS PurchaseConnector to 6.10.1 diff --git a/README.md b/README.md index bf6fc87..5690a51 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ ## This Module is Built for - iOS version 9 and higher. -- Unity AppsFlyer plugin **6.10.1** and higher. +- Unity AppsFlyer plugin **6.12.2** and higher. - Unity version **2020.3** and higher. -- Google Billing Play version **4.x.x**. +- Google Billing Play version **5.x.x**. To use the module with earlier Unity AppsFlyer plugin versions, check the previous versions of this module, for instance, **v1.0.0** supports versions **6.8.1** and higher. @@ -99,8 +99,20 @@ AppsFlyerPurchaseConnector.setPurchaseRevenueValidationListeners(true); public void didReceivePurchaseRevenueValidationInfo(string validationInfo) { AppsFlyer.AFLog("didReceivePurchaseRevenueValidationInfo", validationInfo); -} + // deserialize the string as a dictionnary, easy to manipulate + Dictionary dictionary = AFMiniJSON.Json.Deserialize(validationInfo) as Dictionary; + + // if the platform is Android, you can create an object from the dictionnary +#if UNITY_ANDROID + if (dictionary.ContainsKey("productPurchase") && dictionary["productPurchase"] != null) + { + // Create an object from the JSON string. + InAppPurchaseValidationResult iapObject = JsonUtility.FromJson(validationInfo); + } elif (dictionary.ContainsKey("subscriptionPurchase") && dictionary["subscriptionPurchase"] != null) { + SubscriptionValidationResult iapObject = JsonUtility.FromJson(validationInfo); + #endif +} ```