-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Use case
Now ProductDetails.price is a string formatted in USD, which does not make much sense when you want to show the price formatted in local currency, as described by Apple:
To display the price of a product in the UI, use the locale and currency returned by the App Store. For instance, consider a user who is logged into the French App Store and their device uses the United States locale. When attempting to purchase a product, the App Store displays the product’s price in euros. Thus, converting and showing the product’s price in U.S. dollars to match the device’s locale in the UI would be incorrect.
Proposal
I would suggest to show both priceNumber (as double) and currencyCode (as String) in ProductDetails. You have both items in the wrappers skProduct for iOS and skuDetail for Android.
From skProduct you would need the price and priceLocale.currencyCode.
From SkuDetail you would need priceAmountMicros and priceCurrencyCode.
I think these are the most important and commonly used items from both. You would need to convert price and priceAmountMicros to a double value.