From 48c3cbc0ea247eea54eeca50ea87bb3549d5bfce Mon Sep 17 00:00:00 2001 From: hyochan Date: Sat, 15 Dec 2018 19:10:37 +0900 Subject: [PATCH] Resolve 228 again. Changes not made. --- CHANGELOG.md | 2 +- ios/RNIapIos.m | 33 ++++++++++++++++++--------------- package.json | 2 +- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3508b3194..5d75e0b38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## Changelogs -- **[2.3.22]** +- **[2.3.23]** + Resolve [#288](https://github.com/dooboolab/react-native-iap/issues/288). - **[2.3.21]** + Fixed npe when `getAvailablePurcase` in android. diff --git a/ios/RNIapIos.m b/ios/RNIapIos.m index be0d90fdb..4eb8c5335 100644 --- a/ios/RNIapIos.m +++ b/ios/RNIapIos.m @@ -392,21 +392,24 @@ -(NSDictionary*)getProductObject:(SKProduct *)product { currencyCode = product.priceLocale.currencyCode; } - return @{ - @"productId" : product.productIdentifier, - @"price" : [product.price stringValue], - @"currency" : currencyCode, - @"type": itemType, - @"title" : product.localizedTitle ? product.localizedTitle : @"", - @"description" : product.localizedDescription ? product.localizedDescription : @"", - @"localizedPrice" : localizedPrice, - @"subscriptionPeriodNumberIOS" : periodNumberIOS, - @"subscriptionPeriodUnitIOS" : periodUnitIOS, - @"introductoryPrice" : introductoryPrice, - @"introductoryPricePaymentModeIOS" : introductoryPricePaymentMode, - @"introductoryPriceNumberOfPeriodsIOS" : introductoryPriceNumberOfPeriods, - @"introductoryPriceSubscriptionPeriodIOS" : introductoryPriceSubscriptionPeriod - }; + NSDictionary *obj = [NSDictionary dictionaryWithObjectsAndKeys: + product.productIdentifier, @"productId", + [product.price stringValue], @"price", + currencyCode, @"currency", + itemType, @"type", + product.localizedTitle ? product.localizedTitle : @"", @"title", + product.localizedDescription ? product.localizedDescription : @"", @"description", + localizedPrice, @"localizedPrice", + periodNumberIOS, @"subscriptionPeriodNumberIOS", + periodUnitIOS, @"subscriptionPeriodUnitIOS", + introductoryPrice, @"introductoryPrice", + introductoryPricePaymentMode, @"introductoryPricePaymentModeIOS", + introductoryPriceNumberOfPeriods, @"introductoryPriceNumberOfPeriodsIOS", + introductoryPriceSubscriptionPeriod, @"introductoryPriceSubscriptionPeriodIOS", + nil + ]; + + return obj; } - (NSDictionary *)getPurchaseData:(SKPaymentTransaction *)transaction { diff --git a/package.json b/package.json index 9cc2da859..090e0b014 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-iap", - "version": "2.3.22", + "version": "2.3.23", "description": "React Native In App Purchase Module.", "main": "index.js", "types": "index.d.ts",