-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
pubspec.yaml
in_app_purchase: 3.2.0
in_app_purchase_android: 0.3.6+12
in_app_purchase_platform_interface: 1.4.0
in_app_purchase_storekit: 0.3.20Steps to reproduce
- Pre-requisites: have your products defined in App Store Connect or a local StoreKit config with your products
- Enable StoreKit 2
- Query your products details
Expected results
@LouiseHsu Based on comment #116383 (comment) (and because we have an issue with StoreKit 1 where failed transactions can never be completed when testing as per #98484), we wanted to try StoreKit 2.
We expected the formatted localized string of a product price to be displayable as this to the user, like it was with StoreKit 1.
If the defined price is 24.99 in US Dollar, ProductDetails.price should contains "$24.99" for US locale.
Actual results
We currently have 6 prices defined in App Store Connect and only 2 are displayed as expected with StoreKit 2:
✅ 0.99 -> "$0.99"
❌ 2.99 -> "$2.9899999999999998"
❌ 3.99 -> "$3.9899999999999998"
✅ 8.99 ->"$8.99"
❌ 17.99 -> "$17.990000000000002"
❌ 24.99 -> "$24.990000000000002"
This is the value returned by ProductDetails.price.
The value from (productDetails as AppStoreProduct2Details).sk2Product.displayPrice seems correct.
We found a similar issue discussed in RevenueCat: RevenueCat/purchases-ios#2207
Code sample
Code sample
InAppPurchaseStoreKitPlatform.registerPlatform();
final iapStoreKitPlatform = InAppPurchasePlatform.instance as InAppPurchaseStoreKitPlatform;
iapStoreKitPlatform.enableStoreKit2();
final storeResponse = await InAppPurchase.instance.queryProductDetails({'your_product_id'});Screenshots or Videos
Logs
No response
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.6.1 23G93 darwin-arm64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!

