Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
af-margot committed Aug 28, 2023
1 parent 94a3056 commit c5ba6e7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

## <a id="plugin-build-for"> 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.

Expand Down Expand Up @@ -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<string, object> dictionary = AFMiniJSON.Json.Deserialize(validationInfo) as Dictionary<string, object>;

// 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<InAppPurchaseValidationResult>(validationInfo);
} elif (dictionary.ContainsKey("subscriptionPurchase") && dictionary["subscriptionPurchase"] != null) {
SubscriptionValidationResult iapObject = JsonUtility.FromJson<SubscriptionValidationResult>(validationInfo);
#endif

}
```


Expand Down

0 comments on commit c5ba6e7

Please sign in to comment.