Skip to content

[in_app_purchase] Update Play Billing library to 7.1.1 #8218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mchudy
Copy link
Contributor

@mchudy mchudy commented Dec 3, 2024

Updates Play Billing Library to the latest version 7.1.1. Exposes new APIs as per release notes:

  • Adds Dart representation of ProductDetails.InstallmentPlanDetails
  • Adds Dart representation of PendingPurchasesParams and removes the deprecated enablePendingPurchases method on BillingClientWrapper (breaking change)
  • Adds Dart representation of Purchase.PendingPurchaseUpdate
  • Removes the deprecated ProrationMode as it has been removed from the native library (breaking change)

This PR introduces breaking changes in in_app_purchase_android, but does not introduce any breaking changes on the platform interface level.

Fixes flutter/flutter#147394

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@mchudy mchudy changed the title Feature/in app purchase play billing upgrade [in_app_purchase] Update Play Billing library to 7.1.1 Dec 3, 2024
@stuartmorgan-g
Copy link
Contributor

@reidbaker Ping on this review

@reidbaker reidbaker removed their request for review December 18, 2024 19:36
@reidbaker
Copy link
Contributor

@gmackall I am not going to get to this. Deferring to you for review.

@wph144
Copy link

wph144 commented Jan 6, 2025

The billingClient version upgrade process must proceed as quickly as possible.
Older versions of billingClient cause a low probability of missing payments after a certain period of time.
This may result in cases where the consumer makes a payment but does not receive the service for that payment, so the billingClient version upgrade must be done quickly.

Currently, in_app_purchase 3.2.0 is using billingClient 6.2.0,
and billingClient 7.0.0 version was distributed in May 2024,
so it has now taken more than 7 months.
I hope this gets merged quickly.

Copy link
Member

@gmackall gmackall left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, added a couple comments. Sorry for the delay on review

@mchudy
Copy link
Contributor Author

mchudy commented Jan 8, 2025

CI is complaining about versioning, but I believe we should first publish the new version of in_app_purchase_android and only once that lands on pub update the dependency in the base package? Or can this be handled inside a single PR?

@stuartmorgan-g stuartmorgan-g added the federated: all_changes PR that contains changes for all packages for a federated plugin change label Jan 9, 2025
@stuartmorgan-g
Copy link
Contributor

CI is complaining about versioning, but I believe we should first publish the new version of in_app_purchase_android and only once that lands on pub update the dependency in the base package? Or can this be handled inside a single PR?

See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins for the process of landing a multi-package PR with interdependencies.

* **BREAKING CHANGES**:
* Removes the deprecated `ProrationMode` enum. `ReplacementMode` should be used instead.
* Removes the deprecated `BillingClientWrapper.enablePendingPurchases` method.
* Bumps `minSdk` to 21.
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be a breaking change for in_app_purchase when rolling the dependency there; we strongly prefer not dropping OS support before the SDK itself.

In this case, Flutter 3.24+ only supports Android SDK 21+, so the way to make this change would be to update the plugin's min SDK version to 3.24, which makes this no longer a breaking change.

@mchudy mchudy force-pushed the feature/in-app-purchase-play-billing-upgrade branch 2 times, most recently from 1273d51 to f7a56be Compare January 10, 2025 08:22
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
Signed-off-by: Marcin Chudy <marcin.chudy@leancode.pl>
@mchudy mchudy requested a review from stuartmorgan-g January 17, 2025 12:29
Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

Hold on merging for @stuartmorgan's approval. Specifically if all of the json removal work he wants removed has been done.

@@ -1,6 +1,7 @@
## NEXT
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is worthy of a version bump.

.setDebugMessage(billingResult.getDebugMessage())
.build();
}

static @NonNull PlatformBillingResponse fromBillingResponseCode(int billingResponseCode) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for all of this cleanup!

It looks like bulid.yaml can be removed, as well as the json_annotation and json_serializable dependencies in pubspec.yaml, but that's all I see that's left.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Hold on merging for @stuartmorgan's approval.

This PR can't actually be landed as-is; it's saying that it bumps the in_app_purchase_android version in in_app_purchase, but doesn't (and can't in this PR).

I'm going to put a request-changes flag on the PR just to make sure nobody accidentally lands it as is. This is ready to be split into two PRs though (with the minor changes in my previous comment) for landing.

@mchudy
Copy link
Contributor Author

mchudy commented Jan 20, 2025

I removed the JSON dependencies and moved the in_app_purchase package part to #8463

@mchudy mchudy requested a review from stuartmorgan-g January 20, 2025 09:56
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM!

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 20, 2025
@auto-submit auto-submit bot merged commit e8f1f63 into flutter:main Jan 20, 2025
78 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 20, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jan 20, 2025
flutter/packages@f73cb00...e8f1f63

2025-01-20 mchudy@users.noreply.github.com [in_app_purchase] Update Play
Billing library to 7.1.1 (flutter/packages#8218)
2025-01-20 engine-flutter-autoroll@skia.org Roll Flutter from
5517cc9 to b9e86a5 (22 revisions) (flutter/packages#8458)
2025-01-18 stuartmorgan@google.com [pigeon] Update analyzer and
formatter (flutter/packages#8456)
2025-01-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump the gradle-plugin group across 3 directories with 1
update (flutter/packages#8328)
2025-01-17 magder@google.com [local_auth_darwin] Handle when FaceID
hardware is available but permissions have been denied for the app
(flutter/packages#8348)
2025-01-16 engine-flutter-autoroll@skia.org Roll Flutter from
40c2b86 to 5517cc9 (28 revisions) (flutter/packages#8441)
2025-01-15 louisehsu@google.com [in_app_purchase_storekit] expose
`jsonRepresentation` for Transactions (flutter/packages#8430)
2025-01-15 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
17025dd to 68415ad (4 revisions) (flutter/packages#8434)
2025-01-15 30872003+misos1@users.noreply.github.com
[video_player_avfoundation] fix playback speed resetting
(flutter/packages#7657)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Jan 23, 2025
@mchudy mchudy deleted the feature/in-app-purchase-play-billing-upgrade branch January 31, 2025 14:08
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
Updates Play Billing Library to the latest version 7.1.1. Exposes new APIs as per [release notes](https://developer.android.com/google/play/billing/release-notes):
- Adds Dart representation of `ProductDetails.InstallmentPlanDetails`
- Adds Dart representation of `PendingPurchasesParams` and removes the deprecated `enablePendingPurchases` method on `BillingClientWrapper` (breaking change)
- Adds Dart representation of `Purchase.PendingPurchaseUpdate`
- Removes the deprecated `ProrationMode` as it has been removed from the native library (breaking change)

This PR introduces breaking changes in `in_app_purchase_android`, but does not introduce any breaking changes on the platform interface level.

Fixes flutter/flutter#147394
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
Updates Play Billing Library to the latest version 7.1.1. Exposes new APIs as per [release notes](https://developer.android.com/google/play/billing/release-notes):
- Adds Dart representation of `ProductDetails.InstallmentPlanDetails`
- Adds Dart representation of `PendingPurchasesParams` and removes the deprecated `enablePendingPurchases` method on `BillingClientWrapper` (breaking change)
- Adds Dart representation of `Purchase.PendingPurchaseUpdate`
- Removes the deprecated `ProrationMode` as it has been removed from the native library (breaking change)

This PR introduces breaking changes in `in_app_purchase_android`, but does not introduce any breaking changes on the platform interface level.

Fixes flutter/flutter#147394
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App federated: all_changes PR that contains changes for all packages for a federated plugin change p: in_app_purchase platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[in app purchase] Update PlayBilling Library to 7.0
5 participants