@umituz/react-native-subscription 2.43.13 → 2.43.16

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.13",
3
+ "version": "2.43.16",
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",
@@ -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,11 +5,15 @@ 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";
11
14
  import { PaywallTranslations, PaywallLegalUrls, SubscriptionFeature } from "../../../paywall/entities/types";
12
15
  import { usePaywallFeedbackSubmit } from "../../../../presentation/hooks/feedback/useFeedbackSubmit";
16
+ import { PaywallScreen } from "../../../paywall/components/PaywallScreen";
13
17
 
14
18
  export interface ManagedSubscriptionFlowProps {
15
19
  children: React.ReactNode;
@@ -70,9 +74,10 @@ export interface ManagedSubscriptionFlowProps {
70
74
  *
71
75
  * Use this to reduce AppNavigator boilerplate to nearly zero.
72
76
  */
73
- import {
74
- SubscriptionFlowProvider,
75
- useSubscriptionFlowStatus
77
+ import {
78
+ SubscriptionFlowProvider,
79
+ useSubscriptionFlowStatus,
80
+ useSubscriptionFlowStore
76
81
  } from "../providers/SubscriptionFlowProvider";
77
82
  import { SubscriptionFlowStatus } from "../useSubscriptionFlow";
78
83
 
@@ -116,6 +121,7 @@ const ManagedSubscriptionFlowInner = React.memo<ManagedSubscriptionFlowProps>(({
116
121
  heroImage: paywall.heroImage,
117
122
  bestValueIdentifier: paywall.bestValueIdentifier,
118
123
  creditsLabel: paywall.creditsLabel,
124
+ disableNavigation: true, // Paywall is rendered inline, don't navigate
119
125
  });
120
126
 
121
127
  const { submit: internalSubmit } = usePaywallFeedbackSubmit();
@@ -174,6 +180,43 @@ const ManagedSubscriptionFlowInner = React.memo<ManagedSubscriptionFlowProps>(({
174
180
  );
175
181
  }
176
182
 
183
+ // 2.5. Post-Onboarding Paywall View
184
+ if (status === SubscriptionFlowStatus.POST_ONBOARDING_PAYWALL) {
185
+ if (__DEV__) {
186
+ console.log('[ManagedSubscriptionFlow] 💳 Rendering Post-Onboarding Paywall', {
187
+ hasPackages: flowState.showPostOnboardingPaywall
188
+ });
189
+ }
190
+
191
+ const PostOnboardingPaywall = () => {
192
+ const { isPremium, isSyncing, credits } = usePremiumStatus();
193
+ const { packages } = usePremiumPackages();
194
+ const { purchasePackage, restorePurchase } = usePremiumActions();
195
+ const { closePostOnboardingPaywall } = useSubscriptionFlowStore();
196
+
197
+ return (
198
+ <PaywallScreen
199
+ translations={paywall.translations}
200
+ legalUrls={paywall.legalUrls}
201
+ features={paywall.features}
202
+ bestValueIdentifier={paywall.bestValueIdentifier}
203
+ creditsLabel={paywall.creditsLabel}
204
+ heroImage={paywall.heroImage}
205
+ source="onboarding"
206
+ packages={packages}
207
+ isPremium={isPremium}
208
+ credits={credits}
209
+ isSyncing={isSyncing}
210
+ onPurchase={purchasePackage}
211
+ onRestore={restorePurchase}
212
+ onClose={closePostOnboardingPaywall}
213
+ />
214
+ );
215
+ };
216
+
217
+ return <PostOnboardingPaywall />;
218
+ }
219
+
177
220
  // 3. Application Content + Overlays
178
221
  return (
179
222
  <>