@umituz/react-native-subscription 2.41.11 → 2.41.12
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.41.
|
|
3
|
+
"version": "2.41.12",
|
|
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",
|
|
@@ -57,35 +57,6 @@ export function usePaywallOrchestrator({
|
|
|
57
57
|
const purchasedRef = useRef(false);
|
|
58
58
|
const hasNavigatedRef = useRef(false);
|
|
59
59
|
|
|
60
|
-
const handleClose = useCallback(async () => {
|
|
61
|
-
await closePostOnboardingPaywall();
|
|
62
|
-
closePaywall();
|
|
63
|
-
|
|
64
|
-
// Trigger feedback if user declined and isn't premium
|
|
65
|
-
if (!isPremium && !purchasedRef.current) {
|
|
66
|
-
setTimeout(() => setShowFeedback(true), 300);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
purchasedRef.current = false;
|
|
70
|
-
hasNavigatedRef.current = false;
|
|
71
|
-
|
|
72
|
-
if (navigation.canGoBack()) {
|
|
73
|
-
navigation.goBack();
|
|
74
|
-
}
|
|
75
|
-
}, [closePostOnboardingPaywall, closePaywall, isPremium, navigation, setShowFeedback]);
|
|
76
|
-
|
|
77
|
-
const handleSuccess = useCallback(async () => {
|
|
78
|
-
purchasedRef.current = true;
|
|
79
|
-
await markPaywallShown();
|
|
80
|
-
await closePostOnboardingPaywall();
|
|
81
|
-
|
|
82
|
-
onPurchaseSuccess?.();
|
|
83
|
-
|
|
84
|
-
if (navigation.canGoBack()) {
|
|
85
|
-
navigation.goBack();
|
|
86
|
-
}
|
|
87
|
-
}, [markPaywallShown, closePostOnboardingPaywall, onPurchaseSuccess, navigation]);
|
|
88
|
-
|
|
89
60
|
useEffect(() => {
|
|
90
61
|
if (!isNavReady || !isLocalizationReady) return;
|
|
91
62
|
|
|
@@ -108,19 +79,14 @@ export function usePaywallOrchestrator({
|
|
|
108
79
|
});
|
|
109
80
|
|
|
110
81
|
navigation.navigate("PaywallScreen", {
|
|
111
|
-
onClose: handleClose,
|
|
112
82
|
translations,
|
|
113
83
|
legalUrls,
|
|
114
84
|
features,
|
|
115
85
|
bestValueIdentifier,
|
|
116
86
|
creditsLabel,
|
|
117
|
-
onAuthRequired,
|
|
118
|
-
onPurchaseSuccess: handleSuccess,
|
|
119
87
|
heroImage,
|
|
120
88
|
source: shouldShowPostOnboarding ? "onboarding" : "manual",
|
|
121
89
|
packages,
|
|
122
|
-
onPurchase: purchasePackage,
|
|
123
|
-
onRestore: restorePurchase,
|
|
124
90
|
});
|
|
125
91
|
|
|
126
92
|
if (shouldShowPostOnboarding) {
|
|
@@ -144,20 +110,15 @@ export function usePaywallOrchestrator({
|
|
|
144
110
|
isPremium,
|
|
145
111
|
showPaywall,
|
|
146
112
|
navigation,
|
|
147
|
-
handleClose,
|
|
148
|
-
handleSuccess,
|
|
149
113
|
translations,
|
|
150
114
|
legalUrls,
|
|
151
115
|
features,
|
|
152
116
|
heroImage,
|
|
153
117
|
packages,
|
|
154
|
-
purchasePackage,
|
|
155
|
-
restorePurchase,
|
|
156
118
|
markPaywallShown,
|
|
157
119
|
closePaywall,
|
|
158
120
|
bestValueIdentifier,
|
|
159
121
|
creditsLabel,
|
|
160
|
-
onAuthRequired
|
|
161
122
|
]);
|
|
162
123
|
|
|
163
124
|
const completeOnboarding = useSubscriptionFlowStore((state) => state.completeOnboarding);
|