Clarify documentation gaps, update examples, add warning to ensure completePurchase is being called#11601
Conversation
completePurchase is being called
…es into read-me-example-updates
LongCatIsLooong
left a comment
There was a problem hiding this comment.
The documentation LGTM. Did you by any chance look into if it is possible to change the API to force developers to kick off the product delivery process to make sure they don't leave a purchase hanging?
| /// For convenience, [PurchaseDetails.pendingCompletePurchase] indicates if a | ||
| /// purchase is pending for completion. | ||
| /// | ||
| /// **iOS/macOS Warning:** |
There was a problem hiding this comment.
I think dartdoc supports https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts if you think this should be highlighted.
There was a problem hiding this comment.
Also do you mean to make the warning header occupy an entire line? I think when this renders dartdoc probably won't respect the line feed after "**".
There was a problem hiding this comment.
Not completing a transaction on Android for 3 days would result in a refund seems more dire. Is that supposed to be documented here along with the iOS/macOS warning?
There was a problem hiding this comment.
So I looked into wrapping it in a closure, but the biggest problem is that purchases aren't guaranteed to complete immediately (eg. parental controls), and also, purchases aren't always initiated from inside an app (eg code redemption)
So there are multiple edge cases where theres a gap when money is charged and the products are delivered. If the app is terminated during the gap, you can get into a weird state where the transaction was initiated and finished and removed off the transaction queue by our completePurchase() block, but the app has yet to actually handle the purchase.
Fixes flutter/flutter#186377
This PR updates the README.md with lots of examples, and also adds a runtime warning when finish() hasnt been called.
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on [Discord].