react-native-purchases 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,6 @@ Pod::Spec.new do |spec|
24
24
  ]
25
25
 
26
26
  spec.dependency "React-Core"
27
- spec.dependency "PurchasesHybridCommon", '5.0.0'
27
+ spec.dependency "PurchasesHybridCommon", '5.1.0'
28
28
  spec.swift_version = '5.0'
29
29
  end
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '6.0.0'
32
+ versionName '6.1.0'
33
33
  }
34
34
 
35
35
  buildTypes {
@@ -121,6 +121,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
121
121
  dependencies {
122
122
  //noinspection GradleDynamicVersion
123
123
  api 'com.facebook.react:react-native:+'
124
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:5.0.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:5.1.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -45,7 +45,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
45
45
  private static final String CUSTOMER_INFO_UPDATED = "Purchases-CustomerInfoUpdated";
46
46
  private static final String LOG_HANDLER_EVENT = "Purchases-LogHandlerEvent";
47
47
  public static final String PLATFORM_NAME = "react-native";
48
- public static final String PLUGIN_VERSION = "6.0.0";
48
+ public static final String PLUGIN_VERSION = "6.1.0";
49
49
 
50
50
  private final ReactApplicationContext reactContext;
51
51
 
@@ -146,9 +146,6 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
146
146
  if (googleOldProductId == null) {
147
147
  googleOldProductId = googleProductChangeInfo.hasKey("oldSKU") ? googleProductChangeInfo.getString("oldSKU") : null;
148
148
  }
149
- if (googleProrationMode == null) {
150
- googleProrationMode = googleProductChangeInfo.hasKey("prorationMode") ? googleProductChangeInfo.getInt("prorationMode") : null;
151
- }
152
149
  }
153
150
 
154
151
  Boolean googleIsPersonalized = googleInfo != null && googleInfo.hasKey("isPersonalizedPrice") ? googleInfo.getBoolean("isPersonalizedPrice") : null;
@@ -168,13 +165,23 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
168
165
  @ReactMethod
169
166
  public void purchasePackage(final String packageIdentifier,
170
167
  final String offeringIdentifier,
171
- @Nullable final ReadableMap upgradeInfo,
168
+ @Nullable final ReadableMap googleProductChangeInfo,
172
169
  @Nullable final String discountTimestamp,
173
170
  @Nullable final ReadableMap googleInfo,
174
171
  final Promise promise) {
175
- String googleOldProductId = upgradeInfo != null && upgradeInfo.hasKey("oldSKU") ? upgradeInfo.getString("oldSKU") : null;
176
- Integer googleProrationMode = upgradeInfo != null && upgradeInfo.hasKey("prorationMode") ? upgradeInfo.getInt("prorationMode") : null;
172
+ String googleOldProductId = null;
173
+ Integer googleProrationMode = null;
174
+
175
+ if (googleProductChangeInfo != null) {
176
+ // GoogleProductChangeInfo in V6 and later
177
+ googleOldProductId = googleProductChangeInfo.hasKey("oldProductIdentifier") ? googleProductChangeInfo.getString("oldProductIdentifier") : null;
178
+ googleProrationMode = googleProductChangeInfo.hasKey("prorationMode") ? googleProductChangeInfo.getInt("prorationMode") : null;
177
179
 
180
+ // Legacy UpgradeInfo in V5 and earlier
181
+ if (googleOldProductId == null) {
182
+ googleOldProductId = googleProductChangeInfo.hasKey("oldSKU") ? googleProductChangeInfo.getString("oldSKU") : null;
183
+ }
184
+ }
178
185
  Boolean googleIsPersonalized = googleInfo != null && googleInfo.hasKey("isPersonalizedPrice") ? googleInfo.getBoolean("isPersonalizedPrice") : null;
179
186
 
180
187
  CommonKt.purchasePackage(
package/ios/RNPurchases.m CHANGED
@@ -442,7 +442,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
442
442
  }
443
443
 
444
444
  - (NSString *)platformFlavorVersion {
445
- return @"6.0.0";
445
+ return @"6.1.0";
446
446
  }
447
447
 
448
448
  @end
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-purchases",
3
3
  "title": "React Native Purchases",
4
- "version": "6.0.0",
4
+ "version": "6.1.0",
5
5
  "description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android. ",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -2,7 +2,7 @@
2
2
  <!DOCTYPE html>
3
3
  <html>
4
4
  <head>
5
- <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/6.0.0/" />
5
+ <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/6.1.0/" />
6
6
  </head>
7
7
  <body>
8
8
  </body>