Repository navigation
Closed
flutter/packages
#9698Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
What package does this bug report belong to?
in_app_purchase
What target platforms are you seeing this bug on?
iOS
Have you already upgraded your packages?
Yes
Dependency versions
No response
Steps to reproduce
In InAppPurchasePlugin+StoreKit2.swift file:
...
var purchaseOptions: Set<Product.PurchaseOption> = []
if let appAccountToken = options?.appAccountToken,
let accountTokenUUID = UUID(uuidString: appAccountToken)
{
purchaseOptions.insert(.appAccountToken(accountTokenUUID))
}
if let quantity = options?.quantity {
purchaseOptions.insert(.quantity(Int(quantity)))
}
if #available(iOS 17.4, macOS 14.4, *) {
if let promotionalOffer = options?.promotionalOffer {
purchaseOptions.insert(
.promotionalOffer(
offerID: promotionalOffer.promotionalOfferId,
signature: promotionalOffer.promotionalOfferSignature.convertToSignature
)
)
}
}
if #available(iOS 18.0, macOS 15.0, *) {
if let winBackOfferId = options?.winBackOfferId,
let winBackOffer = product.subscription?.winBackOffers.first(where: {
$0.id == winBackOfferId
})
{
purchaseOptions.insert(.winBackOffer(winBackOffer))
}
}
let result = try await product.purchase(options: purchaseOptions)
...
The .quantity was not inserted into purchaseOptions, so I am unable to handle bulk purchase scenarios.
Expected results
Add
if let quantity = options?.quantity {
purchaseOptions.insert(.quantity(Int(quantity)))
}
to the purchase method.
On the Flutter side:
Add quantity: purchasedQuantity, to the convertFromPigeon method.
Actual results
the quantity does not work.
Code sample
Leave a comment
Screenshots or Videos
No response
Logs
No response
Flutter Doctor output
Leave a comment
Reacted by Bradley McCallion
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
tirth-patel-nc commentedon Jul 3, 2025
thanks for the report. labeling this as a new proposal. feel free to submit a PR.
I noticed a related request in a different context, but found the quantity handling code already present in #169646.
nikunjrCybage commentedon Jul 8, 2025
@tirth-patel-nc I’d like to contribute a fix for this. Just confirming — can we go ahead and create a PR to add proper support for the quantity parameter in StoreKit 2 by updating both the Swift and Dart sides accordingly?
tirth-patel-nc commentedon Jul 8, 2025
I'm not aware of the exact changes. you may check the relevant discord channel linked in the contribution guide for more details.
vashworth commentedon Jul 17, 2025
We welcome PRs! Here's the contributor guide to get you started: https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md
[in_app_purchase_storekit] Add support for quantity in consumable pro…
08a9b2c [in_app_purchase_storekit] Add support for quantity in consum…
Roll Packages from a114ac2 to 08a9b2c (3 revisions) (#173625)
Roll Packages from a114ac2 to 08a9b2c (3 revisions) (flutter#173625)
Roll Packages from a114ac2 to 08a9b2c (3 revisions) (flutter#173625)
github-actions commentedon Aug 26, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.