@umituz/react-native-subscription 2.24.7 → 2.24.9
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.9",
|
|
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",
|
|
@@ -72,7 +72,7 @@ export const PaywallFeedbackModal: React.FC<PaywallFeedbackModalProps> = React.m
|
|
|
72
72
|
<Modal
|
|
73
73
|
visible={visible}
|
|
74
74
|
transparent
|
|
75
|
-
animationType="
|
|
75
|
+
animationType="none"
|
|
76
76
|
onRequestClose={handleSkip}
|
|
77
77
|
>
|
|
78
78
|
<Pressable onPress={handleSkip} style={styles.overlay}>
|
|
@@ -22,7 +22,7 @@ export const PurchaseLoadingOverlay: React.FC<PurchaseLoadingOverlayProps> = Rea
|
|
|
22
22
|
if (!isPurchasing) return null;
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<Modal visible transparent animationType="
|
|
25
|
+
<Modal visible transparent animationType="none" statusBarTranslucent>
|
|
26
26
|
<View style={[styles.container, { backgroundColor: "rgba(0, 0, 0, 0.7)" }]}>
|
|
27
27
|
<View style={[styles.content, { backgroundColor: tokens.colors.surface }]}>
|
|
28
28
|
<AtomicSpinner size="lg" color="primary" />
|
|
@@ -8,6 +8,8 @@ import { useAuthGate } from "./useAuthGate";
|
|
|
8
8
|
import { useSubscriptionGate } from "./useSubscriptionGate";
|
|
9
9
|
import { useCreditsGate } from "./useCreditsGate";
|
|
10
10
|
|
|
11
|
+
declare const __DEV__: boolean;
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
export interface UseFeatureGateParams {
|
|
@@ -87,6 +89,10 @@ export function useFeatureGate(
|
|
|
87
89
|
const action = pendingActionRef.current;
|
|
88
90
|
pendingActionRef.current = null;
|
|
89
91
|
isWaitingForPurchaseRef.current = false;
|
|
92
|
+
|
|
93
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
94
|
+
console.log("[useFeatureGate] Credits increased, executing pending action");
|
|
95
|
+
}
|
|
90
96
|
action();
|
|
91
97
|
}
|
|
92
98
|
|
|
@@ -119,13 +125,16 @@ export function useFeatureGate(
|
|
|
119
125
|
// Wrap action to re-check credits after auth succeeds
|
|
120
126
|
// Using refs to get current values when callback executes
|
|
121
127
|
const postAuthAction = () => {
|
|
122
|
-
//
|
|
128
|
+
// Subscription check (bypasses credits if subscribed)
|
|
123
129
|
if (hasSubscriptionRef.current) {
|
|
130
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
131
|
+
console.log("[useFeatureGate] User has subscription, executing action");
|
|
132
|
+
}
|
|
124
133
|
action();
|
|
125
134
|
return;
|
|
126
135
|
}
|
|
127
136
|
|
|
128
|
-
//
|
|
137
|
+
// Credits check
|
|
129
138
|
if (!hasCreditsRef.current) {
|
|
130
139
|
pendingActionRef.current = action;
|
|
131
140
|
isWaitingForPurchaseRef.current = true;
|
|
@@ -134,6 +143,9 @@ export function useFeatureGate(
|
|
|
134
143
|
}
|
|
135
144
|
|
|
136
145
|
// All checks passed
|
|
146
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
147
|
+
console.log("[useFeatureGate] User has credits, executing action");
|
|
148
|
+
}
|
|
137
149
|
action();
|
|
138
150
|
};
|
|
139
151
|
onShowAuthModal(postAuthAction);
|