react-native-purchases 9.5.4 → 9.6.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", '17.10.0'
28
+ spec.dependency "PurchasesHybridCommon", '17.11.0'
29
29
  spec.swift_version = '5.7'
30
30
  end
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '9.5.4'
32
+ versionName '9.6.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:17.10.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:17.11.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -47,7 +47,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
47
47
  private static final String CUSTOMER_INFO_UPDATED = "Purchases-CustomerInfoUpdated";
48
48
  private static final String LOG_HANDLER_EVENT = "Purchases-LogHandlerEvent";
49
49
  public static final String PLATFORM_NAME = "react-native";
50
- public static final String PLUGIN_VERSION = "9.5.4";
50
+ public static final String PLUGIN_VERSION = "9.6.0";
51
51
 
52
52
  private final ReactApplicationContext reactContext;
53
53
 
@@ -3,7 +3,7 @@ import { MakePurchaseResult } from '@revenuecat/purchases-typescript-internal';
3
3
  * Browser implementation of the native module. This will be used in the browser and Expo Go.
4
4
  */
5
5
  export declare const browserNativeModuleRNPurchases: {
6
- setupPurchases: (apiKey: string, appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean, _automaticDeviceIdentifierCollectionEnabled: boolean, _preferredUILocaleOverride: string | null) => Promise<void>;
6
+ setupPurchases: (apiKey: string, appUserID: string | null, _purchasesAreCompletedBy: string | null, _userDefaultsSuiteName: string | null, _storeKitVersion: string | null, _useAmazon: boolean, _shouldShowInAppMessagesAutomatically: boolean, _entitlementVerificationMode: string | null, _pendingTransactionsForPrepaidPlansEnabled: boolean, _diagnosticsEnabled: boolean, _automaticDeviceIdentifierCollectionEnabled: boolean, _preferredUILocaleOverride: string | null) => void;
7
7
  setAllowSharingStoreAccount: (_allowSharing: boolean) => Promise<void>;
8
8
  setSimulatesAskToBuyInSandbox: (_simulatesAskToBuyInSandbox: boolean) => Promise<void>;
9
9
  getOfferings: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
@@ -48,23 +48,27 @@ var packageVersion = '9.1.0';
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, _shouldShowInAppMessagesAutomatically, _entitlementVerificationMode, _pendingTransactionsForPrepaidPlansEnabled, _diagnosticsEnabled, _automaticDeviceIdentifierCollectionEnabled, _preferredUILocaleOverride) { return __awaiter(void 0, void 0, void 0, function () {
52
- return __generator(this, function (_a) {
53
- try {
54
- purchases_js_hybrid_mappings_1.PurchasesCommon.configure({
55
- apiKey: apiKey,
56
- appUserId: appUserID || undefined,
57
- flavor: 'react-native',
58
- flavorVersion: packageVersion,
59
- });
51
+ setupPurchases: function (apiKey, appUserID, _purchasesAreCompletedBy, _userDefaultsSuiteName, _storeKitVersion, _useAmazon, _shouldShowInAppMessagesAutomatically, _entitlementVerificationMode, _pendingTransactionsForPrepaidPlansEnabled, _diagnosticsEnabled, _automaticDeviceIdentifierCollectionEnabled, _preferredUILocaleOverride) {
52
+ try {
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
+ var webPlatformCompatibleApiKeyPrefixList = ['test_', 'rcb_'];
55
+ var isWebPlatformCompatibleApiKey = webPlatformCompatibleApiKeyPrefixList.some(function (prefix) { return apiKey.startsWith(prefix); });
56
+ if (!isWebPlatformCompatibleApiKey && ((0, environment_1.isExpoGo)() || (0, environment_1.isRorkSandbox)())) {
57
+ var platform = (0, environment_1.isRorkSandbox)() ? 'Rork sandbox' : 'Expo Go';
58
+ throw new Error("Invalid API key. The native store is not available when running inside ".concat(platform, ", please use your Test Store API Key or create a development build in order to use native features. See https://rev.cat/sdk-test-store on how to use the Test Store."));
60
59
  }
61
- catch (error) {
62
- console.error('Error configuring Purchases:', error);
63
- throw error;
64
- }
65
- return [2 /*return*/];
66
- });
67
- }); },
60
+ purchases_js_hybrid_mappings_1.PurchasesCommon.configure({
61
+ apiKey: apiKey,
62
+ appUserId: appUserID || undefined,
63
+ flavor: 'react-native',
64
+ flavorVersion: packageVersion,
65
+ });
66
+ }
67
+ catch (error) {
68
+ console.error('Error configuring Purchases:', error);
69
+ throw error;
70
+ }
71
+ },
68
72
  setAllowSharingStoreAccount: function (_allowSharing) { return __awaiter(void 0, void 0, void 0, function () {
69
73
  return __generator(this, function (_a) {
70
74
  (0, utils_1.methodNotSupportedOnWeb)('setAllowSharingStoreAccount');
package/ios/RNPurchases.m CHANGED
@@ -665,7 +665,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
665
665
  }
666
666
 
667
667
  - (NSString *)platformFlavorVersion {
668
- return @"9.5.4";
668
+ return @"9.6.0";
669
669
  }
670
670
 
671
671
  @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": "9.5.4",
4
+ "version": "9.6.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",
@@ -114,7 +114,7 @@
114
114
  ]
115
115
  },
116
116
  "dependencies": {
117
- "@revenuecat/purchases-js-hybrid-mappings": "17.10.0",
118
- "@revenuecat/purchases-typescript-internal": "17.10.0"
117
+ "@revenuecat/purchases-js-hybrid-mappings": "17.11.0",
118
+ "@revenuecat/purchases-typescript-internal": "17.11.0"
119
119
  }
120
120
  }