@umituz/react-native-subscription 2.11.26 → 2.11.27
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/package.json +1 -1
- package/src/presentation/components/feedback/PaywallFeedbackModal.tsx +1 -2
- package/src/presentation/components/paywall/SubscriptionFooter.tsx +0 -1
- package/src/revenuecat/domain/value-objects/RevenueCatConfig.ts +3 -6
- package/src/revenuecat/infrastructure/utils/ApiKeyResolver.ts +3 -9
- package/src/utils/premiumUtils.ts +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.27",
|
|
4
4
|
"description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
TouchableWithoutFeedback,
|
|
12
12
|
TextInput,
|
|
13
13
|
KeyboardAvoidingView,
|
|
14
|
-
Platform,
|
|
15
14
|
} from "react-native";
|
|
16
15
|
import { AtomicText } from "@umituz/react-native-design-system";
|
|
17
16
|
import { useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
@@ -79,7 +78,7 @@ export const PaywallFeedbackModal: React.FC<PaywallFeedbackModalProps> = React.m
|
|
|
79
78
|
<TouchableWithoutFeedback onPress={handleSkip}>
|
|
80
79
|
<View style={styles.overlay}>
|
|
81
80
|
<KeyboardAvoidingView
|
|
82
|
-
behavior=
|
|
81
|
+
behavior="padding"
|
|
83
82
|
style={styles.keyboardView}
|
|
84
83
|
>
|
|
85
84
|
<TouchableWithoutFeedback>
|
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
import type { CustomerInfo } from "react-native-purchases";
|
|
7
7
|
|
|
8
8
|
export interface RevenueCatConfig {
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/** Android API key */
|
|
12
|
-
androidApiKey?: string;
|
|
9
|
+
/** Primary API key - resolved by main app based on platform */
|
|
10
|
+
apiKey?: string;
|
|
13
11
|
/** Test Store key for development/Expo Go testing */
|
|
14
12
|
testStoreKey?: string;
|
|
15
13
|
/** Entitlement identifier to check for premium status (REQUIRED - app specific) */
|
|
@@ -44,7 +42,6 @@ export interface RevenueCatConfig {
|
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
export interface RevenueCatConfigRequired {
|
|
47
|
-
|
|
48
|
-
androidApiKey: string;
|
|
45
|
+
apiKey: string;
|
|
49
46
|
}
|
|
50
47
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* API Key Resolver
|
|
3
3
|
* Resolves RevenueCat API key from configuration
|
|
4
|
+
* NOTE: Main app is responsible for resolving platform-specific keys
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
|
-
import { Platform } from "react-native";
|
|
7
7
|
import type { RevenueCatConfig } from "../../domain/value-objects/RevenueCatConfig";
|
|
8
8
|
import { isExpoGo, isProductionBuild } from "./ExpoGoDetector";
|
|
9
9
|
|
|
@@ -14,23 +14,21 @@ import { isExpoGo, isProductionBuild } from "./ExpoGoDetector";
|
|
|
14
14
|
export function shouldUseTestStore(config: RevenueCatConfig): boolean {
|
|
15
15
|
const testKey = config.testStoreKey;
|
|
16
16
|
|
|
17
|
-
// No test key configured - always use production keys
|
|
18
17
|
if (!testKey) {
|
|
19
18
|
return false;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
// CRITICAL: Production builds should NEVER use test store
|
|
23
21
|
if (isProductionBuild() && !isExpoGo()) {
|
|
24
22
|
return false;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
// Only use test store in Expo Go
|
|
28
25
|
return isExpoGo();
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
/**
|
|
32
29
|
* Get RevenueCat API key from config
|
|
33
30
|
* Returns Test Store key if in Expo Go environment ONLY
|
|
31
|
+
* Main app must provide resolved platform-specific apiKey in config
|
|
34
32
|
*/
|
|
35
33
|
export function resolveApiKey(config: RevenueCatConfig): string | null {
|
|
36
34
|
const useTestStore = shouldUseTestStore(config);
|
|
@@ -39,11 +37,7 @@ export function resolveApiKey(config: RevenueCatConfig): string | null {
|
|
|
39
37
|
return config.testStoreKey ?? null;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
const key =
|
|
43
|
-
? config.iosApiKey
|
|
44
|
-
: Platform.OS === 'android'
|
|
45
|
-
? config.androidApiKey
|
|
46
|
-
: config.iosApiKey;
|
|
40
|
+
const key = config.apiKey;
|
|
47
41
|
|
|
48
42
|
if (!key || key === "" || key.includes("YOUR_")) {
|
|
49
43
|
return null;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Premium Utilities
|
|
3
|
-
*
|
|
4
|
-
* Re-export of premium status utilities for backward compatibility
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// Re-export for backward compatibility
|
|
8
|
-
export { getIsPremium } from './premiumStatusUtils';
|
|
9
|
-
export { getUserTierInfoAsync, checkPremiumAccessAsync } from './premiumAsyncUtils';
|