Repository navigation
[in_app_purchase] Ensure purchases correctly report if they are acknowledged on Android - #4257
Conversation
Co-authored-by: Rene Floor <r.floor.1@gmail.com>
Co-authored-by: Rene Floor <r.floor.1@gmail.com>
| required String? transactionDate, | ||
| required this.billingClientPurchase, | ||
| required PurchaseStatus status, | ||
| bool pendingCompletePurchase = false, |
There was a problem hiding this comment.
This looks like a public API change? The minor version should be updated.
There was a problem hiding this comment.
Can modify it to be a non-public-API change if my below comment is applied.
There was a problem hiding this comment.
Done, thank you for the suggestion.
| verificationData: verificationData, | ||
| status: status, | ||
| ) { | ||
| this.pendingCompletePurchase = pendingCompletePurchase; |
There was a problem hiding this comment.
Since we already have billingClientPurchase, can we just use it?
pendingCompletePurchase = !billingClientPurchase.isAcknowledged
So we don't need the extra pendingCompletePurchase parameter.
There was a problem hiding this comment.
You are 100% correct, thank you for this suggestion. I have committed the necessary changes.
|
Merging this PR as the Windows Plugins tasks seem stuck and this plugin doesn't contain any windows related code which should make is save to merge as all other tasks are green. |
…re acknowledged on Android (flutter-team-archive/plugins#4257)
…re acknowledged on Android (flutter-team-archive/plugins#4257) (#89040)
…wledged on Android (flutter-team-archive#4257) * Ensure purchases correctly show they are acknowledged * Update packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md Co-authored-by: Rene Floor <r.floor.1@gmail.com> * Update packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md Co-authored-by: Rene Floor <r.floor.1@gmail.com> * Modify so public API is not changed Co-authored-by: Rene Floor <r.floor.1@gmail.com>
…wledged on Android (flutter-team-archive#4257) * Ensure purchases correctly show they are acknowledged * Update packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md Co-authored-by: Rene Floor <r.floor.1@gmail.com> * Update packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md Co-authored-by: Rene Floor <r.floor.1@gmail.com> * Modify so public API is not changed Co-authored-by: Rene Floor <r.floor.1@gmail.com>
On Android the indication if a purchase is completed (acknowledged) should be based on the
Purchase.isAcknowledged()method (see documentation) instead of thePurchaseState. As described in issue flutter/flutter#85448 determining if a purchase is completed based on the state results into a problem when purchases are restored. In this case the purchase status will have a value ofPurchaseStatus.restoredwhich doesn't indicate if a purchase is "purchased and not acknowledged" or "purchased and acknowledged". This leads to developers not being able to correctly determine if a purchase still needs to be completed.Resolves flutter/flutter#85448
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
dart format.)[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.