react-native-purchases 10.15.1 → 10.16.1

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.
@@ -25,6 +25,6 @@ Pod::Spec.new do |spec|
25
25
  ]
26
26
 
27
27
  spec.dependency "React-Core"
28
- spec.dependency "PurchasesHybridCommon", '19.14.1'
28
+ spec.dependency "PurchasesHybridCommon", '19.17.0'
29
29
  spec.swift_version = '5.7'
30
30
  end
@@ -35,7 +35,7 @@ android {
35
35
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
36
36
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
37
37
  versionCode 1
38
- versionName '10.15.1'
38
+ versionName '10.16.1'
39
39
  }
40
40
 
41
41
  buildTypes {
@@ -127,6 +127,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
127
127
  dependencies {
128
128
  //noinspection GradleDynamicVersion
129
129
  api 'com.facebook.react:react-native:+'
130
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:19.14.1'
130
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:19.17.0'
131
131
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
132
132
  }
@@ -51,7 +51,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
51
51
  private static final String TRACKED_EVENT = "Purchases-TrackedEvent";
52
52
  private static final String DEBUG_EVENT = "Purchases-DebugEvent";
53
53
  public static final String PLATFORM_NAME = "react-native";
54
- public static final String PLUGIN_VERSION = "10.15.1";
54
+ public static final String PLUGIN_VERSION = "10.16.1";
55
55
 
56
56
  private final ReactApplicationContext reactContext;
57
57
 
@@ -43,7 +43,7 @@ var typeGuards_1 = require("./typeGuards");
43
43
  var environment_1 = require("../utils/environment");
44
44
  var utils_1 = require("./utils");
45
45
  var purchaseSimulatedPackageHelper_1 = require("./simulatedstore/purchaseSimulatedPackageHelper");
46
- var packageVersion = '10.15.1';
46
+ var packageVersion = '10.16.1';
47
47
  /**
48
48
  * Browser implementation of the native module. This will be used in the browser and Expo Go.
49
49
  */
@@ -308,7 +308,7 @@ export default class Purchases {
308
308
  * @param {String?} appUserID An optional unique id for identifying the user. Needs to be a string.
309
309
  * @param {PurchasesAreCompletedBy} [purchasesAreCompletedBy=PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT] Set this to an instance of PurchasesAreCompletedByMyApp if you have your own IAP implementation and want to use only RevenueCat's backend. Default is PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT.
310
310
  * @param {STOREKIT_VERSION} [storeKitVersion=DEFAULT] iOS-only. Defaults to STOREKIT_2. StoreKit 2 is only available on iOS 16+. StoreKit 1 will be used for previous iOS versions regardless of this setting.
311
- * @param {ENTITLEMENT_VERIFICATION_MODE} [entitlementVerificationMode=ENTITLEMENT_VERIFICATION_MODE.DISABLED] Sets the entitlement verifciation mode to use. For more details, check https://rev.cat/trusted-entitlements
311
+ * @param {ENTITLEMENT_VERIFICATION_MODE} [entitlementVerificationMode] Sets the entitlement verifciation mode to use. If not set, the native SDK's default is used (ENTITLEMENT_VERIFICATION_MODE.INFORMATIONAL). For more details, check https://rev.cat/trusted-entitlements
312
312
  * @param {boolean} [useAmazon=false] An optional boolean. Android-only. Set this to true to enable Amazon on compatible devices.
313
313
  * @param {String?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android.
314
314
  * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults.
package/dist/purchases.js CHANGED
@@ -169,7 +169,7 @@ var Purchases = /** @class */ (function () {
169
169
  * @param {String?} appUserID An optional unique id for identifying the user. Needs to be a string.
170
170
  * @param {PurchasesAreCompletedBy} [purchasesAreCompletedBy=PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT] Set this to an instance of PurchasesAreCompletedByMyApp if you have your own IAP implementation and want to use only RevenueCat's backend. Default is PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT.
171
171
  * @param {STOREKIT_VERSION} [storeKitVersion=DEFAULT] iOS-only. Defaults to STOREKIT_2. StoreKit 2 is only available on iOS 16+. StoreKit 1 will be used for previous iOS versions regardless of this setting.
172
- * @param {ENTITLEMENT_VERIFICATION_MODE} [entitlementVerificationMode=ENTITLEMENT_VERIFICATION_MODE.DISABLED] Sets the entitlement verifciation mode to use. For more details, check https://rev.cat/trusted-entitlements
172
+ * @param {ENTITLEMENT_VERIFICATION_MODE} [entitlementVerificationMode] Sets the entitlement verifciation mode to use. If not set, the native SDK's default is used (ENTITLEMENT_VERIFICATION_MODE.INFORMATIONAL). For more details, check https://rev.cat/trusted-entitlements
173
173
  * @param {boolean} [useAmazon=false] An optional boolean. Android-only. Set this to true to enable Amazon on compatible devices.
174
174
  * @param {String?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android.
175
175
  * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults.
@@ -184,8 +184,8 @@ var Purchases = /** @class */ (function () {
184
184
  * @warning If you use purchasesAreCompletedBy=PurchasesAreCompletedByMyApp, you must also provide a value for storeKitVersion.
185
185
  */
186
186
  Purchases.configure = function (configuration) {
187
- var apiKey = configuration.apiKey, _a = configuration.appUserID, appUserID = _a === void 0 ? null : _a, _b = configuration.purchasesAreCompletedBy, purchasesAreCompletedBy = _b === void 0 ? purchases_typescript_internal_1.PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT : _b, userDefaultsSuiteName = configuration.userDefaultsSuiteName, _c = configuration.storeKitVersion, storeKitVersion = _c === void 0 ? purchases_typescript_internal_1.STOREKIT_VERSION.DEFAULT : _c, _d = configuration.useAmazon, useAmazon = _d === void 0 ? false : _d, _e = configuration.shouldShowInAppMessagesAutomatically, shouldShowInAppMessagesAutomatically = _e === void 0 ? true : _e, _f = configuration.entitlementVerificationMode, entitlementVerificationMode = _f === void 0 ? purchases_typescript_internal_1.ENTITLEMENT_VERIFICATION_MODE.DISABLED : _f, _g = configuration.pendingTransactionsForPrepaidPlansEnabled, pendingTransactionsForPrepaidPlansEnabled = _g === void 0 ? false : _g, _h = configuration.diagnosticsEnabled, diagnosticsEnabled = _h === void 0 ? false : _h, _j = configuration.automaticDeviceIdentifierCollectionEnabled, automaticDeviceIdentifierCollectionEnabled = _j === void 0 ? true : _j, preferredUILocaleOverride = configuration.preferredUILocaleOverride, _k = configuration.useExternalPurchaseCustomLinks, useExternalPurchaseCustomLinks = _k === void 0 ? false : _k, _l = configuration.enableExternalPurchasesInSimulator, enableExternalPurchasesInSimulator = _l === void 0 ? true : _l;
188
- var _m = configuration, store = _m.store, galaxyBillingMode = _m.galaxyBillingMode;
187
+ var apiKey = configuration.apiKey, _a = configuration.appUserID, appUserID = _a === void 0 ? null : _a, _b = configuration.purchasesAreCompletedBy, purchasesAreCompletedBy = _b === void 0 ? purchases_typescript_internal_1.PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT : _b, userDefaultsSuiteName = configuration.userDefaultsSuiteName, _c = configuration.storeKitVersion, storeKitVersion = _c === void 0 ? purchases_typescript_internal_1.STOREKIT_VERSION.DEFAULT : _c, _d = configuration.useAmazon, useAmazon = _d === void 0 ? false : _d, _e = configuration.shouldShowInAppMessagesAutomatically, shouldShowInAppMessagesAutomatically = _e === void 0 ? true : _e, entitlementVerificationMode = configuration.entitlementVerificationMode, _f = configuration.pendingTransactionsForPrepaidPlansEnabled, pendingTransactionsForPrepaidPlansEnabled = _f === void 0 ? false : _f, _g = configuration.diagnosticsEnabled, diagnosticsEnabled = _g === void 0 ? false : _g, _h = configuration.automaticDeviceIdentifierCollectionEnabled, automaticDeviceIdentifierCollectionEnabled = _h === void 0 ? true : _h, preferredUILocaleOverride = configuration.preferredUILocaleOverride, _j = configuration.useExternalPurchaseCustomLinks, useExternalPurchaseCustomLinks = _j === void 0 ? false : _j, _k = configuration.enableExternalPurchasesInSimulator, enableExternalPurchasesInSimulator = _k === void 0 ? true : _k;
188
+ var _l = configuration, store = _l.store, galaxyBillingMode = _l.galaxyBillingMode;
189
189
  throwIfNativeModuleNotAvailable();
190
190
  if (!customLogHandler) {
191
191
  this.setLogHandler(function (logLevel, message) {
@@ -356,12 +356,16 @@ var Purchases = /** @class */ (function () {
356
356
  */
357
357
  Purchases.getCurrentOfferingForPlacement = function (placementIdentifier) {
358
358
  return __awaiter(this, void 0, void 0, function () {
359
+ var offering;
359
360
  return __generator(this, function (_a) {
360
361
  switch (_a.label) {
361
362
  case 0: return [4 /*yield*/, throwIfNotConfigured()];
362
363
  case 1:
363
364
  _a.sent();
364
- return [2 /*return*/, RNPurchases.getCurrentOfferingForPlacement(placementIdentifier)];
365
+ return [4 /*yield*/, RNPurchases.getCurrentOfferingForPlacement(placementIdentifier)];
366
+ case 2:
367
+ offering = _a.sent();
368
+ return [2 /*return*/, offering !== null && offering !== void 0 ? offering : null];
365
369
  }
366
370
  });
367
371
  });
@@ -1982,12 +1986,17 @@ var Purchases = /** @class */ (function () {
1982
1986
  */
1983
1987
  Purchases.redeemWebPurchase = function (webPurchaseRedemption) {
1984
1988
  return __awaiter(this, void 0, void 0, function () {
1989
+ var result;
1985
1990
  return __generator(this, function (_a) {
1986
1991
  switch (_a.label) {
1987
1992
  case 0: return [4 /*yield*/, throwIfNotConfigured()];
1988
1993
  case 1:
1989
1994
  _a.sent();
1990
- return [2 /*return*/, RNPurchases.redeemWebPurchase(webPurchaseRedemption.redemptionLink)];
1995
+ return [4 /*yield*/, RNPurchases.redeemWebPurchase(webPurchaseRedemption.redemptionLink)];
1996
+ case 2:
1997
+ result = _a.sent();
1998
+ (0, purchases_typescript_internal_1.normalizePurchasesError)(result === null || result === void 0 ? void 0 : result.error);
1999
+ return [2 /*return*/, result];
1991
2000
  }
1992
2001
  });
1993
2002
  });
package/ios/RNPurchases.m CHANGED
@@ -813,7 +813,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
813
813
  }
814
814
 
815
815
  - (NSString *)platformFlavorVersion {
816
- return @"10.15.1";
816
+ return @"10.16.1";
817
817
  }
818
818
 
819
819
  @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": "10.15.1",
4
+ "version": "10.16.1",
5
5
  "description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android. ",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -124,7 +124,7 @@
124
124
  ]
125
125
  },
126
126
  "dependencies": {
127
- "@revenuecat/purchases-js-hybrid-mappings": "19.14.1",
128
- "@revenuecat/purchases-typescript-internal": "19.14.1"
127
+ "@revenuecat/purchases-js-hybrid-mappings": "19.17.0",
128
+ "@revenuecat/purchases-typescript-internal": "19.17.0"
129
129
  }
130
130
  }