-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[in_app_purchase_storekit] Add support for quantity in consumable product purchases (#171570) #9698
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
base: main
Are you sure you want to change the base?
[in_app_purchase_storekit] Add support for quantity in consumable product purchases (#171570) #9698
Conversation
…duct purchases (#171570)
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
Code Review
This PR adds support for specifying a quantity when purchasing consumable products with StoreKit 2. The implementation is straightforward, but it's missing crucial validation to ensure the quantity is only used for consumable products and that its value is positive, as required by Apple's StoreKit framework. I've suggested adding guards to handle these cases.
922f30a
to
338f91e
Compare
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.
Thanks for the fix! The patch itself LGTM, but you may have to:
- update the PR description a bit so when it gets merged it also closes the associated issue (basically you want to replace the markdown link with the issue url after the "fix" keyword)
- The version of the plugin needs to be bumped and you'll need to add a simple description of this change to the
CHANGELOG
file.
This PR adds support for specifying a
quantity
when purchasing consumable products using StoreKit 2 in thein_app_purchase_storekit
package.✅ What’s changing
quantity
field fromPurchaseParam
and insert it into the native StoreKit 2.purchase(options:)
call.🧪 Testing
Sk2PurchaseParam
:1
when not explicitly provided.buyConsumable
flows usingfakeStoreKit2Platform
.quantity
values.📌 Fixes
Fix #171570