react-native-purchases 9.5.3 → 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.
- package/RNPurchases.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +1 -1
- package/dist/browser/nativeModule.d.ts +1 -1
- package/dist/browser/nativeModule.js +20 -16
- package/ios/RNPurchases.m +1 -1
- package/package.json +3 -3
package/RNPurchases.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -29,7 +29,7 @@ android {
|
|
|
29
29
|
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
30
30
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
31
31
|
versionCode 1
|
|
32
|
-
versionName '9.
|
|
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.
|
|
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.
|
|
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) =>
|
|
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) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
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.
|
|
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.
|
|
118
|
-
"@revenuecat/purchases-typescript-internal": "17.
|
|
117
|
+
"@revenuecat/purchases-js-hybrid-mappings": "17.11.0",
|
|
118
|
+
"@revenuecat/purchases-typescript-internal": "17.11.0"
|
|
119
119
|
}
|
|
120
120
|
}
|