This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[in_app_purchase] Emit empty list when no transactions to restore. #4523
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `InAppPurchaseIosPlatform.purchaseStream` will emit an empty list when after calling the `InAppPurchaseIosPlatform.restoreTransactions()` there are not transactions to restore.
bafa6de to
53e3518
Compare
stuartmorgan-g
suggested changes
Nov 18, 2021
| late String _receiptData; | ||
|
|
||
| bool _isRestoringTransactions = false; | ||
| bool _didReceiveRestoredTransactions = false; |
Contributor
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.
This would be less error-prone as a single state enum rather than two bools; that way it's impossible to have a bug one one is reset but the other isn't. E.g.:
enum _TransactionRestoreState {
notRunning,
waitingForTransactions,
receivedTransaction,
}
3a201de to
94c4be3
Compare
stuartmorgan-g
approved these changes
Nov 19, 2021
Contributor
stuartmorgan-g
left a comment
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 other than a small update for the rename.
| @@ -1,3 +1,7 @@ | |||
| ## 0.3.0 | |||
|
|
|||
| * **BREAKING CHANGE:** `InAppPurchaseIosPlatform.restorePurchase()` emits an empty instance of `List<ProductDetails>` when there were no transactions to restore, indicating that the restore procedure has finished. | |||
Contributor
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.
s/Ios/StoreKit/
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 19, 2021
amantoux
pushed a commit
to amantoux/plugins
that referenced
this pull request
Dec 11, 2021
KyleFin
pushed a commit
to KyleFin/plugins
that referenced
this pull request
Dec 21, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
cla: yes
p: in_app_purchase
waiting for tree to go green
(Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
InAppPurchaseIosPlatform.purchaseStreamwill emit an empty list when after calling theInAppPurchaseIosPlatform.restoreTransactions()there are not transactions to restore.Note that this is a breaking change as the results emitted on the
purchaseStreamare changing.Resolves flutter/flutter#82795
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]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.