diff --git a/README.md b/README.md index bb8afb228..c2f20001e 100644 --- a/README.md +++ b/README.md @@ -306,6 +306,7 @@ Property | iOS | And | Comment `title` | ✓ | ✓ | Returns the title Android and localizedTitle on iOS. `description` | ✓ | ✓ | Returns the localized description on Android and iOS. `introductoryPrice` | ✓ | ✓ | Formatted introductory price of a subscription, including its currency sign, such as €3.99.
The price doesn't include tax. +`introductoryPriceAsAmountIOS` | ✓ | | Localized introductory price string, with only number (eg. `0.99`). `introductoryPricePaymentModeIOS` | ✓ | | The payment mode for this product discount. `introductoryPriceNumberOfPeriods` | ✓ | | An integer that indicates the number of periods the product discount is available. `introductoryPriceNumberOfPeriodsIOS` | ✓ | | An integer that indicates the number of periods the product discount is available. diff --git a/index.ts b/index.ts index 987f9850e..faebeed24 100644 --- a/index.ts +++ b/index.ts @@ -67,6 +67,7 @@ export interface Subscription extends Common { discounts?: Discount[]; introductoryPrice?: string; + introductoryPriceAsAmountIOS?: string; introductoryPricePaymentModeIOS?: string; introductoryPriceNumberOfPeriodsIOS?: string; introductoryPriceSubscriptionPeriodIOS?: string; diff --git a/ios/RNIapIos.m b/ios/RNIapIos.m index c42f0197c..f55c41984 100644 --- a/ios/RNIapIos.m +++ b/ios/RNIapIos.m @@ -523,6 +523,7 @@ -(NSDictionary*)getProductObject:(SKProduct *)product { NSString* localizedPrice = [formatter stringFromNumber:product.price]; NSString* introductoryPrice = localizedPrice; + NSString* introductoryPriceAsAmountIOS = [product.price stringValue]; NSString* introductoryPricePaymentMode = @""; NSString* introductoryPriceNumberOfPeriods = @""; @@ -558,6 +559,7 @@ -(NSDictionary*)getProductObject:(SKProduct *)product { //SKProductDiscount introductoryPriceObj = product.introductoryPrice; formatter.locale = product.introductoryPrice.priceLocale; introductoryPrice = [formatter stringFromNumber:product.introductoryPrice.price]; + introductoryPriceAsAmountIOS = [product.introductoryPrice.price stringValue]; switch (product.introductoryPrice.paymentMode) { case SKProductDiscountPaymentModeFreeTrial: @@ -592,6 +594,7 @@ -(NSDictionary*)getProductObject:(SKProduct *)product { } else { introductoryPrice = @""; + introductoryPriceAsAmountIOS = @""; introductoryPricePaymentMode = @""; introductoryPriceNumberOfPeriods = @""; introductoryPriceSubscriptionPeriod = @""; @@ -620,6 +623,7 @@ -(NSDictionary*)getProductObject:(SKProduct *)product { periodNumberIOS, @"subscriptionPeriodNumberIOS", periodUnitIOS, @"subscriptionPeriodUnitIOS", introductoryPrice, @"introductoryPrice", + introductoryPriceAsAmountIOS, @"introductoryPriceAsAmountIOS", introductoryPricePaymentMode, @"introductoryPricePaymentModeIOS", introductoryPriceNumberOfPeriods, @"introductoryPriceNumberOfPeriodsIOS", introductoryPriceSubscriptionPeriod, @"introductoryPriceSubscriptionPeriodIOS",