react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

introductoryPrice missing and intriductoryPriceAsAmountIOS incorrect

Open LectricAvenue opened this issue 3 months ago • 0 comments

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

  1. introductoryPrice seems to have been inadvertently removed from subscriptionSk2Map
  2. introductoryPriceAsAmountIOS is not an amount but rather a formatted price to display (e.g. '$49.99')

Expected Behavior

  1. introductoryPrice should be set to the formatted amount (e.g. "$49.99")
  2. 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.

LectricAvenue avatar Apr 03 '24 20:04 LectricAvenue