react-native-purchases 10.2.3 → 10.3.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", '18.11.0'
28
+ spec.dependency "PurchasesHybridCommon", '18.14.1'
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 '10.2.3'
32
+ versionName '10.3.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:18.11.0'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:18.14.1'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -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.2.3";
54
+ public static final String PLUGIN_VERSION = "10.3.0";
55
55
 
56
56
  private final ReactApplicationContext reactContext;
57
57
 
@@ -89,6 +89,8 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
89
89
  public void setupPurchases(String apiKey, @Nullable String appUserID,
90
90
  @Nullable String purchasesAreCompletedBy, @Nullable String userDefaultsSuiteName,
91
91
  @Nullable String storeKitVersion, boolean useAmazon,
92
+ @Nullable String storeString,
93
+ @Nullable String galaxyBillingMode,
92
94
  boolean shouldShowInAppMessagesAutomatically,
93
95
  @Nullable String entitlementVerificationMode,
94
96
  boolean pendingTransactionsForPrepaidPlansEnabled,
@@ -97,7 +99,9 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
97
99
  @Nullable String preferredUILocaleOverride) {
98
100
  PlatformInfo platformInfo = new PlatformInfo(PLATFORM_NAME, PLUGIN_VERSION);
99
101
  Store store = Store.PLAY_STORE;
100
- if (useAmazon) {
102
+ if ("GALAXY".equals(storeString)) {
103
+ store = Store.GALAXY;
104
+ } else if (useAmazon) {
101
105
  store = Store.AMAZON;
102
106
  }
103
107
  CommonKt.configure(
@@ -113,7 +117,8 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
113
117
  pendingTransactionsForPrepaidPlansEnabled,
114
118
  diagnosticsEnabled,
115
119
  automaticDeviceIdentifierCollectionEnabled,
116
- preferredUILocaleOverride
120
+ preferredUILocaleOverride,
121
+ galaxyBillingMode
117
122
  );
118
123
  Purchases.getSharedInstance().setUpdatedCustomerInfoListener(this);
119
124
  }
@@ -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) => void;
6
+ 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
7
  setAllowSharingStoreAccount: (_allowSharing: boolean) => Promise<void>;
8
8
  setSimulatesAskToBuyInSandbox: (_simulatesAskToBuyInSandbox: boolean) => Promise<void>;
9
9
  getOfferings: () => Promise<import("@revenuecat/purchases-typescript-internal").PurchasesOfferings>;
@@ -48,7 +48,7 @@ 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) {
51
+ setupPurchases: function (apiKey, appUserID, _purchasesAreCompletedBy, _userDefaultsSuiteName, _storeKitVersion, _useAmazon, _store, _galaxyBillingMode, _shouldShowInAppMessagesAutomatically, _entitlementVerificationMode, _pendingTransactionsForPrepaidPlansEnabled, _diagnosticsEnabled, _automaticDeviceIdentifierCollectionEnabled, _preferredUILocaleOverride) {
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_'];
@@ -1,4 +1,4 @@
1
- import { PURCHASES_ERROR_CODE, UninitializedPurchasesError, UnsupportedPlatformError, CustomerInfo, PurchasesEntitlementInfo, PRORATION_MODE, PACKAGE_TYPE, INTRO_ELIGIBILITY_STATUS, PurchasesOfferings, PurchasesStoreProduct, UpgradeInfo, PurchasesPromotionalOffer, PurchasesPackage, IntroEligibility, PurchasesStoreProductDiscount, SubscriptionOption, PRODUCT_CATEGORY, GoogleProductChangeInfo, PURCHASE_TYPE, BILLING_FEATURE, REFUND_REQUEST_STATUS, LOG_LEVEL, PurchasesConfiguration, CustomerInfoUpdateListener, ShouldPurchasePromoProductListener, MakePurchaseResult, LogHandler, LogInResult, IN_APP_MESSAGE_TYPE, ENTITLEMENT_VERIFICATION_MODE, VERIFICATION_RESULT, STOREKIT_VERSION, PurchasesStoreTransaction, PurchasesOffering, PURCHASES_ARE_COMPLETED_BY_TYPE, PurchasesVirtualCurrencies, PurchasesWinBackOffer, WebPurchaseRedemption, WebPurchaseRedemptionResult, Storefront, STORE_REPLACEMENT_MODE, StoreProductChangeInfo } from "@revenuecat/purchases-typescript-internal";
1
+ import { PURCHASES_ERROR_CODE, UninitializedPurchasesError, UnsupportedPlatformError, CustomerInfo, PurchasesEntitlementInfo, PRORATION_MODE, PACKAGE_TYPE, INTRO_ELIGIBILITY_STATUS, PurchasesOfferings, PurchasesStoreProduct, UpgradeInfo, PurchasesPromotionalOffer, PurchasesPackage, IntroEligibility, PurchasesStoreProductDiscount, SubscriptionOption, PRODUCT_CATEGORY, GoogleProductChangeInfo, PURCHASE_TYPE, BILLING_FEATURE, REFUND_REQUEST_STATUS, LOG_LEVEL, PurchasesConfiguration as BasePurchasesConfiguration, CustomerInfoUpdateListener, ShouldPurchasePromoProductListener, MakePurchaseResult, LogHandler, LogInResult, IN_APP_MESSAGE_TYPE, ENTITLEMENT_VERIFICATION_MODE, VERIFICATION_RESULT, STOREKIT_VERSION, PurchasesStoreTransaction, PurchasesOffering, PURCHASES_ARE_COMPLETED_BY_TYPE, PurchasesVirtualCurrencies, PurchasesWinBackOffer, WebPurchaseRedemption, WebPurchaseRedemptionResult, Storefront, STORE_REPLACEMENT_MODE, StoreProductChangeInfo } from "@revenuecat/purchases-typescript-internal";
2
2
  /**
3
3
  * Result of a syncPurchases operation.
4
4
  */
@@ -8,7 +8,19 @@ export interface SyncPurchasesResult {
8
8
  */
9
9
  customerInfo: CustomerInfo;
10
10
  }
11
- export { PURCHASE_TYPE, PurchasesAreCompletedBy, PurchasesAreCompletedByMyApp, PURCHASES_ARE_COMPLETED_BY_TYPE, BILLING_FEATURE, REFUND_REQUEST_STATUS, LOG_LEVEL, STOREKIT_VERSION, PurchasesConfiguration, CustomerInfoUpdateListener, ShouldPurchasePromoProductListener, MakePurchaseResult, LogHandler, LogInResult, WebPurchaseRedemption, WebPurchaseRedemptionResult, WebPurchaseRedemptionResultType, } from "@revenuecat/purchases-typescript-internal";
11
+ export { PURCHASE_TYPE, PurchasesAreCompletedBy, PurchasesAreCompletedByMyApp, PURCHASES_ARE_COMPLETED_BY_TYPE, BILLING_FEATURE, REFUND_REQUEST_STATUS, LOG_LEVEL, STOREKIT_VERSION, CustomerInfoUpdateListener, ShouldPurchasePromoProductListener, MakePurchaseResult, LogHandler, LogInResult, WebPurchaseRedemption, WebPurchaseRedemptionResult, WebPurchaseRedemptionResultType, } from "@revenuecat/purchases-typescript-internal";
12
+ export interface ConfigurationsByStore {
13
+ PLAY_STORE: {};
14
+ }
15
+ interface BaseConfiguration extends BasePurchasesConfiguration {
16
+ }
17
+ export type PurchasesConfiguration = {
18
+ [S in keyof ConfigurationsByStore]: BaseConfiguration & ConfigurationsByStore[S] & (S extends "PLAY_STORE" ? {
19
+ store?: S;
20
+ } : {
21
+ store: S;
22
+ });
23
+ }[keyof ConfigurationsByStore];
12
24
  /**
13
25
  * Options for tracking a custom paywall impression.
14
26
  */
@@ -219,7 +231,7 @@ export default class Purchases {
219
231
  *
220
232
  * @warning If you use purchasesAreCompletedBy=PurchasesAreCompletedByMyApp, you must also provide a value for storeKitVersion.
221
233
  */
222
- static configure({ apiKey, appUserID, purchasesAreCompletedBy, userDefaultsSuiteName, storeKitVersion, useAmazon, shouldShowInAppMessagesAutomatically, entitlementVerificationMode, pendingTransactionsForPrepaidPlansEnabled, diagnosticsEnabled, automaticDeviceIdentifierCollectionEnabled, preferredUILocaleOverride, }: PurchasesConfiguration): void;
234
+ static configure(configuration: PurchasesConfiguration): void;
223
235
  /**
224
236
  * @deprecated, configure behavior through the RevenueCat dashboard (app.revenuecat.com) instead.
225
237
  * If an user tries to purchase a product that is active on the current app store account,
package/dist/purchases.js CHANGED
@@ -171,8 +171,9 @@ var Purchases = /** @class */ (function () {
171
171
  *
172
172
  * @warning If you use purchasesAreCompletedBy=PurchasesAreCompletedByMyApp, you must also provide a value for storeKitVersion.
173
173
  */
174
- Purchases.configure = function (_a) {
175
- var apiKey = _a.apiKey, _b = _a.appUserID, appUserID = _b === void 0 ? null : _b, _c = _a.purchasesAreCompletedBy, purchasesAreCompletedBy = _c === void 0 ? purchases_typescript_internal_1.PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT : _c, userDefaultsSuiteName = _a.userDefaultsSuiteName, _d = _a.storeKitVersion, storeKitVersion = _d === void 0 ? purchases_typescript_internal_1.STOREKIT_VERSION.DEFAULT : _d, _e = _a.useAmazon, useAmazon = _e === void 0 ? false : _e, _f = _a.shouldShowInAppMessagesAutomatically, shouldShowInAppMessagesAutomatically = _f === void 0 ? true : _f, _g = _a.entitlementVerificationMode, entitlementVerificationMode = _g === void 0 ? purchases_typescript_internal_1.ENTITLEMENT_VERIFICATION_MODE.DISABLED : _g, _h = _a.pendingTransactionsForPrepaidPlansEnabled, pendingTransactionsForPrepaidPlansEnabled = _h === void 0 ? false : _h, _j = _a.diagnosticsEnabled, diagnosticsEnabled = _j === void 0 ? false : _j, _k = _a.automaticDeviceIdentifierCollectionEnabled, automaticDeviceIdentifierCollectionEnabled = _k === void 0 ? true : _k, preferredUILocaleOverride = _a.preferredUILocaleOverride;
174
+ Purchases.configure = function (configuration) {
175
+ 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;
176
+ var _k = configuration, store = _k.store, galaxyBillingMode = _k.galaxyBillingMode;
176
177
  throwIfNativeModuleNotAvailable();
177
178
  if (!customLogHandler) {
178
179
  this.setLogHandler(function (logLevel, message) {
@@ -225,7 +226,7 @@ var Purchases = /** @class */ (function () {
225
226
  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
227
  }
227
228
  }
228
- RNPurchases.setupPurchases(apiKey, appUserID, purchasesCompletedByToUse, userDefaultsSuiteName, storeKitVersionToUse, useAmazon, shouldShowInAppMessagesAutomatically, entitlementVerificationMode, pendingTransactionsForPrepaidPlansEnabled, diagnosticsEnabled, automaticDeviceIdentifierCollectionEnabled, preferredUILocaleOverride);
229
+ RNPurchases.setupPurchases(apiKey, appUserID, purchasesCompletedByToUse, userDefaultsSuiteName, storeKitVersionToUse, useAmazon, store, galaxyBillingMode, shouldShowInAppMessagesAutomatically, entitlementVerificationMode, pendingTransactionsForPrepaidPlansEnabled, diagnosticsEnabled, automaticDeviceIdentifierCollectionEnabled, preferredUILocaleOverride);
229
230
  };
230
231
  /**
231
232
  * @deprecated, configure behavior through the RevenueCat dashboard (app.revenuecat.com) instead.
package/ios/RNPurchases.m CHANGED
@@ -82,6 +82,8 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
82
82
  userDefaultsSuiteName:(nullable NSString *)userDefaultsSuiteName
83
83
  storeKitVersion:(nullable NSString *)storeKitVersion
84
84
  useAmazon:(BOOL)useAmazon
85
+ store:(nullable NSString *)store
86
+ galaxyBillingMode:(nullable NSString *)galaxyBillingMode
85
87
  shouldShowInAppMessagesAutomatically:(BOOL)shouldShowInAppMessagesAutomatically
86
88
  entitlementVerificationMode:(nullable NSString *)entitlementVerificationMode
87
89
  pendingTransactionsForPrepaidPlansEnabled:(BOOL)pendingTransactionsForPrepaidPlansEnabled
@@ -758,7 +760,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
758
760
  }
759
761
 
760
762
  - (NSString *)platformFlavorVersion {
761
- return @"10.2.3";
763
+ return @"10.3.0";
762
764
  }
763
765
 
764
766
  @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.2.3",
4
+ "version": "10.3.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",
@@ -28,6 +28,7 @@
28
28
  "!**/*.iml",
29
29
  "!**/.DS_Store",
30
30
  "!**/.gitignore",
31
+ "!react-native-purchases-store-galaxy",
31
32
  "!react-native-purchases-ui",
32
33
  "!scripts/docs/index.html",
33
34
  "!scripts/setupJest.js"
@@ -46,6 +47,7 @@
46
47
  },
47
48
  "workspaces": [
48
49
  "examples/purchaseTesterTypescript",
50
+ "react-native-purchases-store-galaxy",
49
51
  "react-native-purchases-ui",
50
52
  "e2e-tests/MaestroTestApp"
51
53
  ],
@@ -103,6 +105,7 @@
103
105
  "preset": "react-native",
104
106
  "modulePathIgnorePatterns": [
105
107
  "<rootDir>/examples/purchaseTesterTypescript/",
108
+ "<rootDir>/react-native-purchases-store-galaxy/",
106
109
  "<rootDir>/react-native-purchases-ui/",
107
110
  "<rootDir>/dir/"
108
111
  ],
@@ -115,7 +118,7 @@
115
118
  ]
116
119
  },
117
120
  "dependencies": {
118
- "@revenuecat/purchases-js-hybrid-mappings": "18.11.0",
119
- "@revenuecat/purchases-typescript-internal": "18.11.0"
121
+ "@revenuecat/purchases-js-hybrid-mappings": "18.14.1",
122
+ "@revenuecat/purchases-typescript-internal": "18.14.1"
120
123
  }
121
124
  }