Plugin would fetch all previous purchases every time the BillingClient has been instantiated. This is now removed and users have to explicitly use API calls to fetch the inventory. This prevents various internal state issues in the Android plugin (e.g. a successful purchase also returns a list of purchases). This was the root cause for issue #36.
Remove usage of a deprecated API in the BillingFlowParams builder
The IAP Responses did not contain valid JSON and therefore sometimes didn't make it over to the client. The "originalJson" for once should be encoded (or added as a proper JSON tree) and then always be compliant to the IAPResponse model.
Once a IAP was purchased, the plugin would simply consume the first IAP product it would retrieve from Google. However, the API might return a list of ALL previously purchased items. The plugin will now search for the same SKU and consume only that one.
"fetchInventory" and "buy" APIs will now use the "purchases" fields in the IAPResponse model. (they are, by all means, purchases). This might break some users Apps.
Gradle plugin updated
Example:
Example code now awaits for purchase completion and then updates the list.
Full list of changes in this PR:
Android:
Example: