@umituz/react-native-subscription 2.43.12 → 2.43.15
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.43.
|
|
3
|
+
"version": "2.43.15",
|
|
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",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"version:minor": "npm version minor -m 'chore: release v%s'",
|
|
18
18
|
"version:major": "npm version major -m 'chore: release v%s'",
|
|
19
19
|
"release": "npm publish",
|
|
20
|
-
"push": "git push"
|
|
20
|
+
"push": "git push",
|
|
21
|
+
"setup:skill": "node -e \"const fs = require('fs'); const path = require('path'); const skillDir = path.join(process.env.HOME, '.claude', 'skills', 'react-native-subscription'); fs.mkdirSync(skillDir, {recursive: true}); fs.copyFileSync(path.join(__dirname, 'skills/SKILL.md'), path.join(skillDir, 'SKILL.md')); console.log('✅ @umituz/react-native-subscription setup skill installed to Claude Code!');\""
|
|
21
22
|
},
|
|
22
23
|
"keywords": [
|
|
23
24
|
"react-native",
|
|
@@ -18,6 +18,8 @@ export interface PaywallOrchestratorOptions {
|
|
|
18
18
|
isLocalizationReady?: boolean;
|
|
19
19
|
bestValueIdentifier?: string;
|
|
20
20
|
creditsLabel?: string;
|
|
21
|
+
/** Disable manual navigation (used when paywall is rendered inline) */
|
|
22
|
+
disableNavigation?: boolean;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export function usePaywallOrchestrator({
|
|
@@ -30,6 +32,7 @@ export function usePaywallOrchestrator({
|
|
|
30
32
|
isLocalizationReady = true,
|
|
31
33
|
bestValueIdentifier = "yearly",
|
|
32
34
|
creditsLabel,
|
|
35
|
+
disableNavigation = false,
|
|
33
36
|
}: PaywallOrchestratorOptions) {
|
|
34
37
|
const { isPremium, isSyncing, credits } = usePremiumStatus();
|
|
35
38
|
const { packages } = usePremiumPackages();
|
|
@@ -67,6 +70,25 @@ export function usePaywallOrchestrator({
|
|
|
67
70
|
if (hasNavigatedRef.current) return;
|
|
68
71
|
hasNavigatedRef.current = true;
|
|
69
72
|
|
|
73
|
+
// Skip navigation if disabled (paywall rendered inline)
|
|
74
|
+
if (disableNavigation) {
|
|
75
|
+
if (__DEV__) {
|
|
76
|
+
console.log('[usePaywallOrchestrator] ⏭️ Skipping navigation (disableNavigation=true)', {
|
|
77
|
+
source: shouldShowPostOnboarding ? "onboarding" : "manual",
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (shouldShowPostOnboarding) {
|
|
82
|
+
markPaywallShown();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (showPaywall) {
|
|
86
|
+
closePaywall();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
70
92
|
if (__DEV__) console.log('[usePaywallOrchestrator] 🚀 Navigating to Paywall', {
|
|
71
93
|
source: shouldShowPostOnboarding ? "onboarding" : "manual",
|
|
72
94
|
packagesCount: packages.length
|
|
@@ -123,6 +145,7 @@ export function usePaywallOrchestrator({
|
|
|
123
145
|
purchasePackage,
|
|
124
146
|
restorePurchase,
|
|
125
147
|
handleClose,
|
|
148
|
+
disableNavigation,
|
|
126
149
|
]);
|
|
127
150
|
|
|
128
151
|
const completeOnboarding = useSubscriptionFlowStore((state) => state.completeOnboarding);
|
|
@@ -5,6 +5,9 @@ import { SplashScreen, useSplashFlow } from "@umituz/react-native-design-system/
|
|
|
5
5
|
import { OnboardingScreen } from "@umituz/react-native-design-system/onboarding";
|
|
6
6
|
import { OfflineBanner } from "@umituz/react-native-design-system/offline";
|
|
7
7
|
import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
|
|
8
|
+
import { usePremiumStatus } from "../../presentation/usePremiumStatus";
|
|
9
|
+
import { usePremiumPackages } from "../../presentation/usePremiumPackages";
|
|
10
|
+
import { usePremiumActions } from "../../presentation/usePremiumActions";
|
|
8
11
|
import { usePaywallOrchestrator } from "../../../paywall/hooks/usePaywallOrchestrator";
|
|
9
12
|
import { PaywallFeedbackScreen } from "../../../subscription/presentation/components/feedback/PaywallFeedbackScreen";
|
|
10
13
|
import { PaywallFeedbackTranslations } from "../../../subscription/presentation/components/feedback/PaywallFeedbackScreen.types";
|
|
@@ -70,9 +73,10 @@ export interface ManagedSubscriptionFlowProps {
|
|
|
70
73
|
*
|
|
71
74
|
* Use this to reduce AppNavigator boilerplate to nearly zero.
|
|
72
75
|
*/
|
|
73
|
-
import {
|
|
74
|
-
SubscriptionFlowProvider,
|
|
75
|
-
useSubscriptionFlowStatus
|
|
76
|
+
import {
|
|
77
|
+
SubscriptionFlowProvider,
|
|
78
|
+
useSubscriptionFlowStatus,
|
|
79
|
+
useSubscriptionFlowStore
|
|
76
80
|
} from "../providers/SubscriptionFlowProvider";
|
|
77
81
|
import { SubscriptionFlowStatus } from "../useSubscriptionFlow";
|
|
78
82
|
|
|
@@ -116,6 +120,7 @@ const ManagedSubscriptionFlowInner = React.memo<ManagedSubscriptionFlowProps>(({
|
|
|
116
120
|
heroImage: paywall.heroImage,
|
|
117
121
|
bestValueIdentifier: paywall.bestValueIdentifier,
|
|
118
122
|
creditsLabel: paywall.creditsLabel,
|
|
123
|
+
disableNavigation: true, // Paywall is rendered inline, don't navigate
|
|
119
124
|
});
|
|
120
125
|
|
|
121
126
|
const { submit: internalSubmit } = usePaywallFeedbackSubmit();
|
|
@@ -174,6 +179,46 @@ const ManagedSubscriptionFlowInner = React.memo<ManagedSubscriptionFlowProps>(({
|
|
|
174
179
|
);
|
|
175
180
|
}
|
|
176
181
|
|
|
182
|
+
// 2.5. Post-Onboarding Paywall View
|
|
183
|
+
if (status === SubscriptionFlowStatus.POST_ONBOARDING_PAYWALL) {
|
|
184
|
+
if (__DEV__) {
|
|
185
|
+
console.log('[ManagedSubscriptionFlow] 💳 Rendering Post-Onboarding Paywall', {
|
|
186
|
+
hasPackages: flowState.showPostOnboardingPaywall
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const { PaywallScreen } = require("../../../paywall/components/PaywallScreen");
|
|
191
|
+
|
|
192
|
+
// We need to wrap this in a component that can use hooks
|
|
193
|
+
const InlinePaywall = () => {
|
|
194
|
+
const { isPremium, isSyncing, credits } = usePremiumStatus();
|
|
195
|
+
const { packages } = usePremiumPackages();
|
|
196
|
+
const { purchasePackage, restorePurchase } = usePremiumActions();
|
|
197
|
+
const { closePostOnboardingPaywall } = useSubscriptionFlowStore();
|
|
198
|
+
|
|
199
|
+
return (
|
|
200
|
+
<PaywallScreen
|
|
201
|
+
translations={paywall.translations}
|
|
202
|
+
legalUrls={paywall.legalUrls}
|
|
203
|
+
features={paywall.features}
|
|
204
|
+
bestValueIdentifier={paywall.bestValueIdentifier}
|
|
205
|
+
creditsLabel={paywall.creditsLabel}
|
|
206
|
+
heroImage={paywall.heroImage}
|
|
207
|
+
source="onboarding"
|
|
208
|
+
packages={packages}
|
|
209
|
+
isPremium={isPremium}
|
|
210
|
+
credits={credits}
|
|
211
|
+
isSyncing={isSyncing}
|
|
212
|
+
onPurchase={purchasePackage}
|
|
213
|
+
onRestore={restorePurchase}
|
|
214
|
+
onClose={closePostOnboardingPaywall}
|
|
215
|
+
/>
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
return <InlinePaywall />;
|
|
220
|
+
}
|
|
221
|
+
|
|
177
222
|
// 3. Application Content + Overlays
|
|
178
223
|
return (
|
|
179
224
|
<>
|