react-native-purchases 10.10.2 → 10.11.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.
@@ -25,6 +25,6 @@ Pod::Spec.new do |spec|
25
25
  ]
26
26
 
27
27
  spec.dependency "React-Core"
28
- spec.dependency "PurchasesHybridCommon", '19.3.1'
28
+ spec.dependency "PurchasesHybridCommon", '19.5.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.10.2'
38
+ versionName '10.11.0'
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.3.1'
130
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:19.5.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.10.2";
54
+ public static final String PLUGIN_VERSION = "10.11.0";
55
55
 
56
56
  private final ReactApplicationContext reactContext;
57
57
 
@@ -96,7 +96,9 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
96
96
  boolean pendingTransactionsForPrepaidPlansEnabled,
97
97
  boolean diagnosticsEnabled,
98
98
  boolean automaticDeviceIdentifierCollectionEnabled,
99
- @Nullable String preferredUILocaleOverride) {
99
+ @Nullable String preferredUILocaleOverride,
100
+ boolean useExternalPurchaseCustomLinks,
101
+ boolean enableExternalPurchasesInSimulator) {
100
102
  PlatformInfo platformInfo = new PlatformInfo(PLATFORM_NAME, PLUGIN_VERSION);
101
103
  Store store = Store.PLAY_STORE;
102
104
  if ("GALAXY".equals(storeString)) {
@@ -4,7 +4,7 @@ import type { RewardedAdTrackingMetadata } from '../purchases';
4
4
  * Browser implementation of the native module. This will be used in the browser and Expo Go.
5
5
  */
6
6
  export declare const browserNativeModuleRNPurchases: {
7
- setupPurchases: (apiKey: string, appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _store: string | null, _galaxyBillingMode: string | null, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean, _automaticDeviceIdentifierCollectionEnabled: boolean, _preferredUILocaleOverride: string | null) => void;
7
+ setupPurchases: (apiKey: string, appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _store: string | null, _galaxyBillingMode: string | null, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean, _automaticDeviceIdentifierCollectionEnabled: boolean, _preferredUILocaleOverride: string | null, _useExternalPurchaseCustomLinks: boolean, _enableExternalPurchasesInSimulator: boolean) => void;
8
8
  setAllowSharingStoreAccount: (_allowSharing: boolean) => Promise<void>;
9
9
  setSimulatesAskToBuyInSandbox: (_simulatesAskToBuyInSandbox: boolean) => Promise<void>;
10
10
  getOfferings: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
@@ -43,12 +43,12 @@ 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.10.2';
46
+ var packageVersion = '10.11.0';
47
47
  /**
48
48
  * Browser implementation of the native module. This will be used in the browser and Expo Go.
49
49
  */
50
50
  exports.browserNativeModuleRNPurchases = {
51
- setupPurchases: function (apiKey, appUserID, _purchasesAreCompletedBy, _userDefaultsSuiteName, _storeKitVersion, _useAmazon, _store, _galaxyBillingMode, _shouldShowInAppMessagesAutomatically, _entitlementVerificationMode, _pendingTransactionsForPrepaidPlansEnabled, _diagnosticsEnabled, _automaticDeviceIdentifierCollectionEnabled, _preferredUILocaleOverride) {
51
+ setupPurchases: function (apiKey, appUserID, _purchasesAreCompletedBy, _userDefaultsSuiteName, _storeKitVersion, _useAmazon, _store, _galaxyBillingMode, _shouldShowInAppMessagesAutomatically, _entitlementVerificationMode, _pendingTransactionsForPrepaidPlansEnabled, _diagnosticsEnabled, _automaticDeviceIdentifierCollectionEnabled, _preferredUILocaleOverride, _useExternalPurchaseCustomLinks, _enableExternalPurchasesInSimulator) {
52
52
  try {
53
53
  // Make sure that when running in Expo Go or Rork sandbox a web-compatible API key is used, because the underlying purchases-js error message isn't super clear when a non-compatible API key type is used in this case
54
54
  var webPlatformCompatibleApiKeyPrefixList = ['test_', 'rcb_'];
@@ -284,6 +284,8 @@ export default class Purchases {
284
284
  * @param {boolean} [diagnosticsEnabled=false] An optional boolean. Set this to true to enable SDK diagnostics.
285
285
  * @param {boolean} [automaticDeviceIdentifierCollectionEnabled=true] An optional boolean. Set this to true to allow the collection of identifiers when setting the identifier for an attribution network.
286
286
  * @param {String?} [preferredUILocaleOverride] An optional string. Set this to the preferred UI locale to use for RevenueCat UI components.
287
+ * @param {boolean} [useExternalPurchaseCustomLinks=false] Experimental. An optional boolean. iOS-only. Set this to true to make web purchase buttons that open in the external browser go through Apple's external purchase custom link flow.
288
+ * @param {boolean} [enableExternalPurchasesInSimulator=true] Experimental. An optional boolean. iOS-only. Set this to false to make the simulator behave as a device does for a customer who is not eligible for external purchases.
287
289
  *
288
290
  * @warning If you use purchasesAreCompletedBy=PurchasesAreCompletedByMyApp, you must also provide a value for storeKitVersion.
289
291
  */
package/dist/purchases.js CHANGED
@@ -167,12 +167,14 @@ var Purchases = /** @class */ (function () {
167
167
  * @param {boolean} [diagnosticsEnabled=false] An optional boolean. Set this to true to enable SDK diagnostics.
168
168
  * @param {boolean} [automaticDeviceIdentifierCollectionEnabled=true] An optional boolean. Set this to true to allow the collection of identifiers when setting the identifier for an attribution network.
169
169
  * @param {String?} [preferredUILocaleOverride] An optional string. Set this to the preferred UI locale to use for RevenueCat UI components.
170
+ * @param {boolean} [useExternalPurchaseCustomLinks=false] Experimental. An optional boolean. iOS-only. Set this to true to make web purchase buttons that open in the external browser go through Apple's external purchase custom link flow.
171
+ * @param {boolean} [enableExternalPurchasesInSimulator=true] Experimental. An optional boolean. iOS-only. Set this to false to make the simulator behave as a device does for a customer who is not eligible for external purchases.
170
172
  *
171
173
  * @warning If you use purchasesAreCompletedBy=PurchasesAreCompletedByMyApp, you must also provide a value for storeKitVersion.
172
174
  */
173
175
  Purchases.configure = function (configuration) {
174
- 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;
175
- var _k = configuration, store = _k.store, galaxyBillingMode = _k.galaxyBillingMode;
176
+ 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;
177
+ var _m = configuration, store = _m.store, galaxyBillingMode = _m.galaxyBillingMode;
176
178
  throwIfNativeModuleNotAvailable();
177
179
  if (!customLogHandler) {
178
180
  this.setLogHandler(function (logLevel, message) {
@@ -225,7 +227,7 @@ var Purchases = /** @class */ (function () {
225
227
  console.warn("Warning: You should provide the specific StoreKit version you're using in your implementation when configuring PURCHASES_ARE_COMPLETED_BY_TYPE.MY_APP, and not rely on the DEFAULT.");
226
228
  }
227
229
  }
228
- RNPurchases.setupPurchases(apiKey, appUserID, purchasesCompletedByToUse, userDefaultsSuiteName, storeKitVersionToUse, useAmazon, store, galaxyBillingMode, shouldShowInAppMessagesAutomatically, entitlementVerificationMode, pendingTransactionsForPrepaidPlansEnabled, diagnosticsEnabled, automaticDeviceIdentifierCollectionEnabled, preferredUILocaleOverride);
230
+ RNPurchases.setupPurchases(apiKey, appUserID, purchasesCompletedByToUse, userDefaultsSuiteName, storeKitVersionToUse, useAmazon, store, galaxyBillingMode, shouldShowInAppMessagesAutomatically, entitlementVerificationMode, pendingTransactionsForPrepaidPlansEnabled, diagnosticsEnabled, automaticDeviceIdentifierCollectionEnabled, preferredUILocaleOverride, useExternalPurchaseCustomLinks, enableExternalPurchasesInSimulator);
229
231
  };
230
232
  /**
231
233
  * @deprecated, configure behavior through the RevenueCat dashboard (app.revenuecat.com) instead.
package/ios/RNPurchases.m CHANGED
@@ -89,7 +89,9 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
89
89
  pendingTransactionsForPrepaidPlansEnabled:(BOOL)pendingTransactionsForPrepaidPlansEnabled
90
90
  diagnosticsEnabled:(BOOL)diagnosticsEnabled
91
91
  automaticDeviceIdentifierCollectionEnabled:(BOOL)automaticDeviceIdentifierCollectionEnabled
92
- preferredUILocaleOverride:(nullable NSString *)preferredUILocaleOverride) {
92
+ preferredUILocaleOverride:(nullable NSString *)preferredUILocaleOverride
93
+ useExternalPurchaseCustomLinks:(BOOL)useExternalPurchaseCustomLinks
94
+ enableExternalPurchasesInSimulator:(BOOL)enableExternalPurchasesInSimulator) {
93
95
  RCPurchases *purchases = [RCPurchases configureWithAPIKey:apiKey.mappingNSNullToNil
94
96
  appUserID:appUserID.mappingNSNullToNil
95
97
  purchasesAreCompletedBy:purchasesAreCompletedBy.mappingNSNullToNil
@@ -102,7 +104,9 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
102
104
  verificationMode:entitlementVerificationMode.mappingNSNullToNil
103
105
  diagnosticsEnabled:diagnosticsEnabled
104
106
  automaticDeviceIdentifierCollectionEnabled:automaticDeviceIdentifierCollectionEnabled
105
- preferredLocale:preferredUILocaleOverride.mappingNSNullToNil];
107
+ preferredLocale:preferredUILocaleOverride.mappingNSNullToNil
108
+ useExternalPurchaseCustomLinks:useExternalPurchaseCustomLinks
109
+ enableExternalPurchasesInSimulator:enableExternalPurchasesInSimulator];
106
110
  purchases.delegate = self;
107
111
  }
108
112
 
@@ -785,7 +789,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
785
789
  }
786
790
 
787
791
  - (NSString *)platformFlavorVersion {
788
- return @"10.10.2";
792
+ return @"10.11.0";
789
793
  }
790
794
 
791
795
  @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.10.2",
4
+ "version": "10.11.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
  "module": "dist/index.js",
@@ -118,7 +118,7 @@
118
118
  ]
119
119
  },
120
120
  "dependencies": {
121
- "@revenuecat/purchases-js-hybrid-mappings": "19.3.1",
122
- "@revenuecat/purchases-typescript-internal": "19.3.1"
121
+ "@revenuecat/purchases-js-hybrid-mappings": "19.5.0",
122
+ "@revenuecat/purchases-typescript-internal": "19.5.0"
123
123
  }
124
124
  }