Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
review comments fix
  • Loading branch information
Chris Yang committed Dec 11, 2019
commit d63cc132fb238eb459051bb6074448767f1fd90c
2 changes: 1 addition & 1 deletion packages/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

* Migrate the `Google Play Library` to 2.0.3.
* **[Breaking Change]:** Added `enablePendingPurchases` in `InAppPurchaseConnection`. The application has
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think a link to the Play documentation on enablePendingPurchases would be useful here.

to call this method when initializing the `InAppPurchaseConnection` on Android.
to call this method when initializing the `InAppPurchaseConnection` on Android. See [enablePendingPurchases](https://developer.android.com/reference/com/android/billingclient/api/BillingClient.Builder.html#enablependingpurchases) for more information.
* Introduce a new class `BillingResultWrapper` which contains a detailed result of a BillingClient operation.
* **[Breaking Change]:** All the BillingClient methods that previously return a `BillingResponse` now return a `BillingResultWrapper`, including: `launchBillingFlow`, `startConnection` and `consumeAsync`.
* **[Breaking Change]:** The `SkuDetailsResponseWrapper` now contains a `billingResult` field in place of `billingResponse` field.
Expand Down
3 changes: 3 additions & 0 deletions packages/in_app_purchase/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import 'package:in_app_purchase/in_app_purchase.dart';
import 'consumable_store.dart';

void main() {
// For play billing library 2.0 on Android, it is mandatory to call
// [enablePendingPurchases](https://developer.android.com/reference/com/android/billingclient/api/BillingClient.Builder.html#enablependingpurchases)
// as part of initializing the app.
InAppPurchaseConnection.enablePendingPurchases();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Comment here explaining what this is and linking to the Play documentation would be useful.

runApp(MyApp());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ class BillingClient {

/// Enable the [BillingClientWrapper] to handle pending purchases.
///
/// This method is required to be called when initialize the application.
/// Play requires that you call this method when initializing your application.
/// It is to acknowledge your application has been updated to support pending purchases.
/// See [Support pending transactions](https://developer.android.com/google/play/billing/billing_library_overview#pending)
/// for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: paragraph break below would make sense, I think.

///
/// Failure to call this method before any other method in the [startConnection] will throw an exception.
void enablePendingPurchases() {
_enablePendingPurchases = true;
Expand Down