react-native-iap
react-native-iap copied to clipboard
introductoryPrice missing and intriductoryPriceAsAmountIOS incorrect
Please use the Discussion board if you want to get some help. Please use issues to report bugs.
Description
-
introductoryPrice
seems to have been inadvertently removed fromsubscriptionSk2Map
-
introductoryPriceAsAmountIOS
is not an amount but rather a formatted price to display (e.g. '$49.99')
Expected Behavior
-
introductoryPrice
should be set to the formatted amount (e.g. "$49.99") -
intriductoryPriceAsAmountIOS
should be a string representing only the value ("49.99")
The fix is below:
introductoryPrice: subscription?.introductoryOffer?.displayPrice,
introductoryPriceAsAmountIOS: String(subscription?.introductoryOffer?.price),
I don't know why introductoryPriceAsAmountIOS
is a string, it seems a number would be better, but that is what is correct based on the TS Type SubscriptionIOS
.
For now, I just use patch-package to fix this for myself
Environment:
- react-native-iap: 12.13.0
To Reproduce
Call getSubscriptions
using any valid SKU with a discounted introductory price (not a free trial) while using SK2.