-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[in_app_purchase] Add alternative billing apis for android #6056
[in_app_purchase] Add alternative billing apis for android #6056
Conversation
… handle service unavilable in getBillingConfig
…ring fallback path
…ingOnlyAvailable to android platform addition and billing client wrapper.
…lingOnlyAvailable in platfrom addition and billing_client
@@ -1,3 +1,7 @@ | |||
## 0.3.0+19 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: As a new feature it should be incrementing the "minor" version (which for <1.0 in Dart convention is the third instead of the second), so this should be 0.3.1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, and thank you for letting me know.
I do think that it is weird that0.3.0+19 is less than 0.3.1
..._app_purchase/in_app_purchase_android/lib/src/in_app_purchase_android_platform_addition.dart
Show resolved
Hide resolved
...se_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java
Show resolved
Hide resolved
...se_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java
Outdated
Show resolved
Hide resolved
..._app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java
Outdated
Show resolved
Hide resolved
...roid/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.dart
Outdated
Show resolved
Hide resolved
...purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart
Outdated
Show resolved
Hide resolved
...purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart
Show resolved
Hide resolved
Requesting re-review because I had to modify a decent bit of code to support billing mode as an enum. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart
Show resolved
Hide resolved
...se_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java
Show resolved
Hide resolved
...se_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java
Outdated
Show resolved
Hide resolved
...se_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java
Show resolved
Hide resolved
...purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_manager.dart
Outdated
Show resolved
Hide resolved
..._app_purchase/in_app_purchase_android/lib/src/in_app_purchase_android_platform_addition.dart
Outdated
Show resolved
Hide resolved
...pp_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart
Outdated
Show resolved
Hide resolved
...pp_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
if (billingChoiceMode == BillingChoiceMode.ALTERNATIVE_BILLING_ONLY) { | ||
// https://developer.android.com/google/play/billing/alternative/alternative-billing-without-user-choice-in-app | ||
builder.enableAlternativeBillingOnly(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an actionable comment, but: Interesting that the billing client builder example they show at the link doesn't call enablePendingPurchases
. That must be a mistake in their documentation, right? It is documented as required in all circumstances
https://developer.android.com/reference/com/android/billingclient/api/BillingClient.Builder#enablePendingPurchases()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I am not sure. Organizationally I think it should be safe to include because if the caller was going to use alternative billing only then there are no pending purchases to enable or if there are all that happens on the callers side since they are providing the billing implementation.
flutter/packages@0a69259...9385bbb 2024-02-13 [email protected] Convert startProductRequest(), finishTransaction(), restoreTransactions(), presentCodeRedemptionSheet() to pigeon (flutter/packages#6032) 2024-02-13 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump org.json:json from 20231013 to 20240205 in /packages/in_app_purchase/in_app_purchase/example/android/app (flutter/packages#6096) 2024-02-12 [email protected] [local_auth] Rename iOS classes (flutter/packages#6108) 2024-02-12 [email protected] [video_player_android] Handle BehindLiveWindowException (flutter/packages#5869) 2024-02-12 [email protected] [in_app_purchase] Add alternative billing apis for android (flutter/packages#6056) 2024-02-12 [email protected] [webview_flutter] Update compileSdk to 34 (flutter/packages#6106) 2024-02-12 [email protected] [cupertino_icons] Add example to cupertino icons (flutter/packages#5312) 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 [email protected],[email protected] 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
Seems there is a deadline to switch from manual reporting to the API by March 13. Is there a chance this will be in a release prior to that? Else we'll have to use a patched version or implement our own and then switch over |
This was released three weeks ago. |
Most all of the apis are available except the combined user choice billing. To get the latest android plugin you will need to reference the android version that was recently released. Also if you are planning on using these apis I would welcome your code review on #6162 which I am hoping to land soon. |
) - Update the emulator versions and expose cipd. (flutter#6025 - Enable alternitive billing only available check, add test and code to handle service unavilable in getBillingConfig - Enable alternative billing only during client creation and tests covering fallback path - ShowAlternativeBillingDialog android native method added - Add tests for null activity behavior - Remove not needed lines of code - Add showAlternativeBillingOnlyInformationDialog and isAlternativeBillingOnlyAvailable to android platform addition and billing client wrapper. - test showAlternativeBillingOnlyInformationDialog and isAlternativeBillingOnlyAvailable in platfrom addition and billing_client Fixes flutter/flutter/issues/142618 Still left TODO: * [x] incorporate new apis into example app * [x] expose alternative billing only [dart api](https://github.com/flutter/packages/pull/6056/files/d4c445422f2cd3f0627f575d85b59b559e0e9f69#r1480455450) * [x] Expose alternative billing reporting details * [ ] Configure end to end working example with playstore
Fixes flutter/flutter/issues/142618
Still left TODO:
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).