react-native-purchases 9.1.0 → 9.2.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.
- package/RNPurchases.podspec +1 -1
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +1 -1
- package/dist/{preview → browser}/nativeModule.d.ts +39 -40
- package/dist/{preview → browser}/nativeModule.js +218 -160
- package/dist/browser/typeGuards.d.ts +23 -0
- package/dist/browser/typeGuards.js +61 -0
- package/dist/browser/utils.d.ts +6 -0
- package/dist/browser/utils.js +18 -0
- package/dist/purchases.d.ts +0 -1
- package/dist/purchases.js +5 -78
- package/dist/utils/environment.d.ts +5 -1
- package/dist/utils/environment.js +6 -5
- package/ios/RNPurchases.m +1 -1
- package/package.json +7 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @returns {boolean} True if the app is running in an environment where native modules are not available
|
|
6
6
|
* (like Expo Go or Web) or if the required native modules are missing.
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function shouldUseBrowserMode(): boolean;
|
|
9
9
|
declare global {
|
|
10
10
|
var expo: {
|
|
11
11
|
modules?: {
|
|
@@ -13,3 +13,7 @@ declare global {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Detects if the app is running in Expo Go
|
|
18
|
+
*/
|
|
19
|
+
export declare function isExpoGo(): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isExpoGo = exports.shouldUseBrowserMode = void 0;
|
|
4
4
|
var react_native_1 = require("react-native");
|
|
5
5
|
/**
|
|
6
6
|
* Detects if the app is running in an environment where native modules are not available
|
|
@@ -9,20 +9,20 @@ var react_native_1 = require("react-native");
|
|
|
9
9
|
* @returns {boolean} True if the app is running in an environment where native modules are not available
|
|
10
10
|
* (like Expo Go or Web) or if the required native modules are missing.
|
|
11
11
|
*/
|
|
12
|
-
function
|
|
12
|
+
function shouldUseBrowserMode() {
|
|
13
13
|
if (isExpoGo()) {
|
|
14
|
-
console.log('Expo Go app detected. Using RevenueCat in
|
|
14
|
+
console.log('Expo Go app detected. Using RevenueCat in Browser Mode.');
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
17
|
else if (isWebPlatform()) {
|
|
18
|
-
console.log('Web platform detected. Using RevenueCat in
|
|
18
|
+
console.log('Web platform detected. Using RevenueCat in Browser Mode.');
|
|
19
19
|
return true;
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.
|
|
25
|
+
exports.shouldUseBrowserMode = shouldUseBrowserMode;
|
|
26
26
|
/**
|
|
27
27
|
* Detects if the app is running in Expo Go
|
|
28
28
|
*/
|
|
@@ -33,6 +33,7 @@ function isExpoGo() {
|
|
|
33
33
|
}
|
|
34
34
|
return !!((_b = (_a = globalThis.expo) === null || _a === void 0 ? void 0 : _a.modules) === null || _b === void 0 ? void 0 : _b.ExpoGo);
|
|
35
35
|
}
|
|
36
|
+
exports.isExpoGo = isExpoGo;
|
|
36
37
|
/**
|
|
37
38
|
* Detects if the app is running on web platform
|
|
38
39
|
*/
|
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.1
|
|
4
|
+
"version": "9.2.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",
|
|
@@ -108,9 +108,14 @@
|
|
|
108
108
|
"cacheDirectory": ".jest/cache",
|
|
109
109
|
"setupFiles": [
|
|
110
110
|
"./scripts/setupJest.js"
|
|
111
|
+
],
|
|
112
|
+
"transformIgnorePatterns": [
|
|
113
|
+
"node_modules/(?!(@revenuecat/purchases-js-hybrid-mappings|@react-native|react-native)/)"
|
|
111
114
|
]
|
|
112
115
|
},
|
|
113
116
|
"dependencies": {
|
|
114
|
-
"@revenuecat/purchases-
|
|
117
|
+
"@revenuecat/purchases-js-hybrid-mappings": "16.2.1",
|
|
118
|
+
"@revenuecat/purchases-typescript-internal": "16.2.1",
|
|
119
|
+
"react-native-get-random-values": "^1.11.0"
|
|
115
120
|
}
|
|
116
121
|
}
|