react-native-purchases 9.5.2 → 9.5.3
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/android/build.gradle +1 -1
- 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 +1 -1
- package/dist/purchases.js +6 -1
- package/dist/utils/environment.d.ts +4 -0
- package/dist/utils/environment.js +12 -1
- package/ios/RNPurchases.m +1 -1
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
50
|
+
public static final String PLUGIN_VERSION = "9.5.3";
|
|
51
51
|
|
|
52
52
|
private final ReactApplicationContext reactContext;
|
|
53
53
|
|
|
@@ -15,7 +15,7 @@ export declare const browserNativeModuleRNPurchases: {
|
|
|
15
15
|
getStorefront: () => Promise<void>;
|
|
16
16
|
setDebugLogsEnabled: (_enabled: boolean) => Promise<void>;
|
|
17
17
|
setLogLevel: (level: string) => Promise<void>;
|
|
18
|
-
setLogHandler: (handler: (message: string) => void) => Promise<void>;
|
|
18
|
+
setLogHandler: (handler: (level: string, message: string) => void) => Promise<void>;
|
|
19
19
|
getCustomerInfo: () => Promise<import("@revenuecat/purchases-typescript-internal").CustomerInfo>;
|
|
20
20
|
logIn: (appUserID: string) => Promise<{
|
|
21
21
|
customerInfo: import("@revenuecat/purchases-typescript-internal").CustomerInfo;
|
|
@@ -246,7 +246,7 @@ exports.browserNativeModuleRNPurchases = {
|
|
|
246
246
|
switch (_a.label) {
|
|
247
247
|
case 0:
|
|
248
248
|
(0, utils_1.ensurePurchasesConfigured)();
|
|
249
|
-
if (!(0, environment_1.isExpoGo)()) return [3 /*break*/, 2];
|
|
249
|
+
if (!((0, environment_1.isExpoGo)() || (0, environment_1.isRorkSandbox)())) return [3 /*break*/, 2];
|
|
250
250
|
return [4 /*yield*/, (0, purchaseSimulatedPackageHelper_1.purchaseSimulatedPackage)(packageIdentifier, presentedOfferingContext)];
|
|
251
251
|
case 1: return [2 /*return*/, _a.sent()];
|
|
252
252
|
case 2: return [4 /*yield*/, purchases_js_hybrid_mappings_1.PurchasesCommon.getInstance().purchasePackage({
|
package/dist/purchases.js
CHANGED
|
@@ -627,7 +627,12 @@ var Purchases = /** @class */ (function () {
|
|
|
627
627
|
*/
|
|
628
628
|
Purchases.setLogHandler = function (logHandler) {
|
|
629
629
|
customLogHandler = logHandler;
|
|
630
|
-
|
|
630
|
+
if (usingBrowserMode) {
|
|
631
|
+
RNPurchases.setLogHandler(logHandler);
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
RNPurchases.setLogHandler();
|
|
635
|
+
}
|
|
631
636
|
};
|
|
632
637
|
/**
|
|
633
638
|
* Gets current customer info
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isExpoGo = exports.shouldUseBrowserMode = void 0;
|
|
3
|
+
exports.isRorkSandbox = 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
|
|
@@ -14,6 +14,10 @@ function shouldUseBrowserMode() {
|
|
|
14
14
|
console.log('Expo Go app detected. Using RevenueCat in Browser Mode.');
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
|
+
else if (isRorkSandbox()) {
|
|
18
|
+
console.log('Rork app detected. Using RevenueCat in Preview API Mode.');
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
17
21
|
else if (isWebPlatform()) {
|
|
18
22
|
console.log('Web platform detected. Using RevenueCat in Browser Mode.');
|
|
19
23
|
return true;
|
|
@@ -34,6 +38,13 @@ function isExpoGo() {
|
|
|
34
38
|
return !!((_b = (_a = globalThis.expo) === null || _a === void 0 ? void 0 : _a.modules) === null || _b === void 0 ? void 0 : _b.ExpoGo);
|
|
35
39
|
}
|
|
36
40
|
exports.isExpoGo = isExpoGo;
|
|
41
|
+
/**
|
|
42
|
+
* Detects if the app is running in the Rork app
|
|
43
|
+
*/
|
|
44
|
+
function isRorkSandbox() {
|
|
45
|
+
return !!react_native_1.NativeModules.RorkSandbox;
|
|
46
|
+
}
|
|
47
|
+
exports.isRorkSandbox = isRorkSandbox;
|
|
37
48
|
/**
|
|
38
49
|
* Detects if the app is running on web platform
|
|
39
50
|
*/
|
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.5.
|
|
4
|
+
"version": "9.5.3",
|
|
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",
|