@umituz/react-native-subscription 2.14.99 → 2.14.100

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.
Files changed (92) hide show
  1. package/README.md +211 -394
  2. package/package.json +1 -1
  3. package/src/application/README.md +46 -225
  4. package/src/application/ports/README.md +42 -97
  5. package/src/domain/README.md +36 -384
  6. package/src/domain/constants/README.md +0 -56
  7. package/src/domain/entities/README.md +43 -169
  8. package/src/domain/errors/README.md +33 -287
  9. package/src/domain/value-objects/README.md +43 -179
  10. package/src/domains/README.md +50 -238
  11. package/src/domains/README.md.bak +274 -0
  12. package/src/domains/config/README.md +93 -383
  13. package/src/domains/config/domain/README.md +23 -376
  14. package/src/domains/config/domain/entities/README.md +34 -343
  15. package/src/domains/paywall/README.md +99 -369
  16. package/src/domains/paywall/components/README.md +34 -178
  17. package/src/domains/paywall/entities/README.md +34 -193
  18. package/src/domains/paywall/hooks/README.md +34 -122
  19. package/src/domains/wallet/README.md +34 -275
  20. package/src/domains/wallet/README.md.bak +209 -0
  21. package/src/domains/wallet/domain/README.md +34 -101
  22. package/src/domains/wallet/domain/entities/README.md +34 -115
  23. package/src/domains/wallet/domain/errors/README.md +34 -151
  24. package/src/domains/wallet/infrastructure/README.md +34 -89
  25. package/src/domains/wallet/presentation/components/README.md +34 -224
  26. package/src/domains/wallet/presentation/hooks/README.md +34 -248
  27. package/src/infrastructure/README.md +37 -496
  28. package/src/infrastructure/mappers/README.md +0 -13
  29. package/src/infrastructure/repositories/README.md +74 -360
  30. package/src/infrastructure/services/README.md +95 -370
  31. package/src/presentation/README.md +123 -408
  32. package/src/presentation/README.md.bak +172 -0
  33. package/src/presentation/components/README.md +151 -179
  34. package/src/presentation/components/README.md.bak +217 -0
  35. package/src/presentation/components/details/CreditRow.md +65 -310
  36. package/src/presentation/components/details/DetailRow.md +63 -255
  37. package/src/presentation/components/details/PremiumDetailsCard.md +65 -238
  38. package/src/presentation/components/details/PremiumStatusBadge.md +64 -239
  39. package/src/presentation/components/details/README.md +97 -447
  40. package/src/presentation/components/feedback/PaywallFeedbackModal.md +63 -287
  41. package/src/presentation/components/feedback/README.md +97 -445
  42. package/src/presentation/components/paywall/PaywallModal.md +66 -416
  43. package/src/presentation/components/paywall/README.md +50 -186
  44. package/src/presentation/components/sections/README.md +97 -466
  45. package/src/presentation/components/sections/SubscriptionSection.md +92 -244
  46. package/src/presentation/hooks/README.md +154 -741
  47. package/src/presentation/hooks/useAuthAwarePurchase.md +58 -325
  48. package/src/presentation/hooks/useAuthGate.md +61 -375
  49. package/src/presentation/hooks/useAuthSubscriptionSync.md +66 -370
  50. package/src/presentation/hooks/useCreditChecker.md +73 -378
  51. package/src/presentation/hooks/useCredits.md +74 -313
  52. package/src/presentation/hooks/useCredits.md.bak +231 -0
  53. package/src/presentation/hooks/useCreditsGate.md +66 -318
  54. package/src/presentation/hooks/useDeductCredit.md +0 -76
  55. package/src/presentation/hooks/useDevTestCallbacks.md +63 -394
  56. package/src/presentation/hooks/useFeatureGate.md +105 -150
  57. package/src/presentation/hooks/useFeatureGate.md.bak +284 -0
  58. package/src/presentation/hooks/useInitializeCredits.md +64 -430
  59. package/src/presentation/hooks/usePaywall.md +61 -306
  60. package/src/presentation/hooks/usePaywallOperations.md +64 -458
  61. package/src/presentation/hooks/usePaywallVisibility.md +67 -316
  62. package/src/presentation/hooks/usePremium.md +84 -226
  63. package/src/presentation/hooks/usePremiumGate.md +60 -395
  64. package/src/presentation/hooks/usePremiumWithCredits.md +64 -401
  65. package/src/presentation/hooks/useSubscription.md +66 -422
  66. package/src/presentation/hooks/useSubscriptionDetails.md +65 -410
  67. package/src/presentation/hooks/useSubscriptionGate.md +80 -164
  68. package/src/presentation/hooks/useSubscriptionSettingsConfig.md +66 -346
  69. package/src/presentation/hooks/useSubscriptionStatus.md +66 -396
  70. package/src/presentation/hooks/useUserTier.md +63 -328
  71. package/src/presentation/hooks/useUserTierWithRepository.md +64 -424
  72. package/src/presentation/screens/README.md +48 -190
  73. package/src/presentation/types/README.md +0 -16
  74. package/src/presentation/utils/README.md +0 -21
  75. package/src/revenuecat/README.md +99 -518
  76. package/src/revenuecat/application/README.md +35 -150
  77. package/src/revenuecat/application/ports/README.md +34 -162
  78. package/src/revenuecat/domain/README.md +42 -141
  79. package/src/revenuecat/domain/constants/README.md +34 -176
  80. package/src/revenuecat/domain/entities/README.md +34 -374
  81. package/src/revenuecat/domain/errors/README.md +47 -191
  82. package/src/revenuecat/domain/types/README.md +34 -366
  83. package/src/revenuecat/domain/value-objects/README.md +34 -434
  84. package/src/revenuecat/infrastructure/README.md +34 -43
  85. package/src/revenuecat/infrastructure/config/README.md +32 -23
  86. package/src/revenuecat/infrastructure/handlers/README.md +34 -211
  87. package/src/revenuecat/infrastructure/managers/README.md +34 -42
  88. package/src/revenuecat/infrastructure/services/README.md +35 -318
  89. package/src/revenuecat/infrastructure/utils/README.md +34 -375
  90. package/src/revenuecat/presentation/README.md +34 -176
  91. package/src/revenuecat/presentation/hooks/README.md +29 -35
  92. package/src/utils/README.md +38 -525
@@ -1,314 +1,90 @@
1
1
  # PaywallFeedbackModal Component
2
2
 
3
- Modal for collecting user feedback when declining paywall/subscription.
3
+ Modal component for collecting user feedback after paywall dismissal.
4
4
 
5
- ## Import
5
+ ## Location
6
6
 
7
- ```typescript
8
- import { PaywallFeedbackModal } from '@umituz/react-native-subscription';
9
- ```
7
+ **Import Path**: `@umituz/react-native-subscription`
10
8
 
11
- ## Signature
9
+ **File**: `src/presentation/components/feedback/PaywallFeedbackModal.tsx`
12
10
 
13
- ```typescript
14
- interface PaywallFeedbackModalProps {
15
- visible: boolean;
16
- onClose: () => void;
17
- onSubmit: (reason: string) => void;
18
- title?: string;
19
- subtitle?: string;
20
- submitText?: string;
21
- otherPlaceholder?: string;
22
- }
23
- ```
11
+ **Type**: Component
24
12
 
25
- ## Props
13
+ ## Strategy
26
14
 
27
- | Prop | Type | Default | Description |
28
- |------|------|---------|-------------|
29
- | `visible` | `boolean` | **Required** | Modal visibility |
30
- | `onClose` | `() => void` | **Required** | Close handler |
31
- | `onSubmit` | `(reason: string) => void` | **Required** | Submit feedback handler |
32
- | `title` | `string` | `t('paywall.feedback.title')` | Modal title |
33
- | `subtitle` | `string` | `t('paywall.feedback.subtitle')` | Modal subtitle |
34
- | `submitText` | `string` | `t('paywall.feedback.submit')` | Submit button text |
35
- | `otherPlaceholder` | `string` | `t('paywall.feedback.otherPlaceholder')` | Other text input placeholder |
15
+ ### Feedback Collection Flow
36
16
 
37
- ## Basic Usage
17
+ 1. **Trigger Display**: Show modal after paywall dismissal
18
+ 2. **Feedback Options**: Provide multiple feedback options
19
+ 3. **Reason Capture**: Allow users to select reason for not upgrading
20
+ 4. **Comment Input**: Optional text input for detailed feedback
21
+ 5. **Submission**: Handle feedback submission
22
+ 6. **Analytics**: Track feedback for optimization
38
23
 
39
- ```typescript
40
- function PaywallScreen() {
41
- const [showFeedback, setShowFeedback] = useState(false);
24
+ ### Integration Points
42
25
 
43
- const handleClose = () => {
44
- setShowFeedback(true);
45
- };
26
+ - **PaywallModal**: Trigger after paywall close
27
+ - **Analytics Service**: Track feedback responses
28
+ - **Backend API**: Submit feedback to server
29
+ - **usePaywall**: For paywall state management
46
30
 
47
- const handleSubmitFeedback = (reason: string) => {
48
- analytics.track('paywall_feedback', { reason });
49
- setShowFeedback(false);
50
- navigation.goBack();
51
- };
31
+ ## Restrictions
52
32
 
53
- return (
54
- <View>
55
- <PaywallContent onClose={handleClose} />
33
+ ### REQUIRED
56
34
 
57
- <PaywallFeedbackModal
58
- visible={showFeedback}
59
- onClose={() => setShowFeedback(false)}
60
- onSubmit={handleSubmitFeedback}
61
- />
62
- </View>
63
- );
64
- }
65
- ```
35
+ - **Visible Control**: MUST control visibility via prop
36
+ - **Callback Handling**: MUST implement onFeedbackSubmit callback
37
+ - **Close Handler**: MUST provide close mechanism
38
+ - **Feedback Options**: MUST provide clear feedback options
66
39
 
67
- ## Advanced Usage
40
+ ### PROHIBITED
68
41
 
69
- ### With Custom Content
42
+ - **NEVER** show modal automatically (user-triggered only)
43
+ - **NEVER** make feedback mandatory
44
+ - **DO NOT** show too frequently (respect user experience)
45
+ - **DO NOT** require personal information
70
46
 
71
- ```typescript
72
- function CustomFeedbackModal() {
73
- const [visible, setVisible] = useState(false);
47
+ ### CRITICAL SAFETY
74
48
 
75
- return (
76
- <PaywallFeedbackModal
77
- visible={visible}
78
- onClose={() => setVisible(false)}
79
- onSubmit={(reason) => {
80
- console.log('Feedback:', reason);
81
- setVisible(false);
82
- }}
83
- title="Help Us Improve"
84
- subtitle="Why are you not upgrading today?"
85
- submitText="Send Feedback"
86
- otherPlaceholder="Please tell us more..."
87
- />
88
- );
89
- }
90
- ```
49
+ - **ALWAYS** make feedback optional
50
+ - **MUST** provide clear close option
51
+ - **ALWAYS** keep feedback anonymous by default
52
+ - **NEVER** collect sensitive information
91
53
 
92
- ### With Analytics Tracking
54
+ ## AI Agent Guidelines
93
55
 
94
- ```typescript
95
- function TrackedFeedbackModal() {
96
- const [visible, setVisible] = useState(false);
97
- const [paywallTrigger] = useState('premium_feature');
56
+ ### When Implementing Feedback Modals
98
57
 
99
- const handleSubmit = (reason: string) => {
100
- analytics.track('paywall_decline_feedback', {
101
- reason,
102
- trigger: paywallTrigger,
103
- timestamp: Date.now(),
104
- });
58
+ 1. **Always** make feedback optional
59
+ 2. **Always** provide clear close button
60
+ 3. **Always** keep feedback options concise
61
+ 4. **Always** handle feedback submission gracefully
62
+ 5. **Never** show modal too frequently
105
63
 
106
- // Send to backend
107
- api.trackFeedback({
108
- type: 'paywall_decline',
109
- reason,
110
- context: { trigger: paywallTrigger },
111
- });
64
+ ### Integration Checklist
112
65
 
113
- setVisible(false);
114
- };
66
+ - [ ] Import from correct path: `@umituz/react-native-subscription`
67
+ - [ ] Control visibility via isVisible prop
68
+ - [ ] Implement onFeedbackSubmit callback
69
+ - [ ] Provide onClose callback
70
+ - [ ] Keep feedback options concise (3-5 options)
71
+ - [ ] Make feedback optional
72
+ - [ ] Handle submission errors
73
+ - [ ] Test with various feedback selections
74
+ - [ ] Test close behavior
75
+ - [ ] Verify analytics tracking
115
76
 
116
- return (
117
- <PaywallFeedbackModal
118
- visible={visible}
119
- onClose={() => setVisible(false)}
120
- onSubmit={handleSubmit}
121
- />
122
- );
123
- }
124
- ```
77
+ ### Common Patterns
125
78
 
126
- ### With Conditional Display
79
+ 1. **Post-Paywall**: Show after paywall dismissal
80
+ 2. **Anonymous Feedback**: Keep feedback anonymous
81
+ 3. **Simple Options**: Provide 3-5 quick options
82
+ 4. **Optional Comment**: Allow optional detailed feedback
83
+ 5. **Analytics Integration**: Track feedback for insights
127
84
 
128
- ```typescript
129
- function ConditionalFeedback() {
130
- const [showFeedback, setShowFeedback] = useState(false);
131
- const [hasSeenFeedback, setHasSeenFeedback] = useState(false);
85
+ ## Related Documentation
132
86
 
133
- const handleClose = () => {
134
- // Only show feedback if user hasn't seen it recently
135
- const lastSeen = await AsyncStorage.getItem('last_feedback_date');
136
- const daysSinceLastSeen = lastSeen
137
- ? (Date.now() - parseInt(lastSeen)) / (1000 * 60 * 60 * 24)
138
- : Infinity;
139
-
140
- if (daysSinceLastSeen > 30) {
141
- setShowFeedback(true);
142
- } else {
143
- navigation.goBack();
144
- }
145
- };
146
-
147
- const handleSubmit = async (reason: string) => {
148
- await AsyncStorage.setItem('last_feedback_date', Date.now().toString());
149
- setShowFeedback(false);
150
- navigation.goBack();
151
- };
152
-
153
- return (
154
- <PaywallFeedbackModal
155
- visible={showFeedback}
156
- onClose={() => setShowFeedback(false)}
157
- onSubmit={handleSubmit}
158
- />
159
- );
160
- }
161
- ```
162
-
163
- ## Feedback Options
164
-
165
- The modal includes these predefined options:
166
-
167
- 1. **too_expensive** - "Too expensive"
168
- 2. **no_need** - "Don't need it right now"
169
- 3. **trying_out** - "Just trying out the app"
170
- 4. **technical_issues** - "Technical issues"
171
- 5. **other** - "Other" (with text input)
172
-
173
- ## Examples
174
-
175
- ### Complete Paywall with Feedback
176
-
177
- ```typescript
178
- function CompletePaywallFlow() {
179
- const [showFeedback, setShowFeedback] = useState(false);
180
-
181
- const handlePaywallClose = () => {
182
- setShowFeedback(true);
183
- };
184
-
185
- const handleFeedbackSubmit = (reason: string) => {
186
- // Track feedback
187
- analytics.track('paywall_feedback_submitted', { reason });
188
-
189
- // Send to backend
190
- fetch('/api/feedback', {
191
- method: 'POST',
192
- body: JSON.stringify({
193
- type: 'paywall_decline',
194
- reason,
195
- userId: user?.uid,
196
- timestamp: Date.now(),
197
- }),
198
- });
199
-
200
- setShowFeedback(false);
201
- navigation.goBack();
202
- };
203
-
204
- const handleFeedbackSkip = () => {
205
- analytics.track('paywall_feedback_skipped');
206
- setShowFeedback(false);
207
- navigation.goBack();
208
- };
209
-
210
- return (
211
- <View>
212
- <PaywallScreen onClose={handlePaywallClose} />
213
-
214
- <PaywallFeedbackModal
215
- visible={showFeedback}
216
- onClose={handleFeedbackSkip}
217
- onSubmit={handleFeedbackSubmit}
218
- title="Help Us Improve"
219
- subtitle="Why are you not upgrading today?"
220
- submitText="Send Feedback"
221
- otherPlaceholder="Tell us more (optional)"
222
- />
223
- </View>
224
- );
225
- }
226
- ```
227
-
228
- ### With A/B Testing
229
-
230
- ```typescript
231
- function ABTestedFeedback() {
232
- const [showFeedback, setShowFeedback] = useState(false);
233
- const [variant, setVariant] = useState<'short' | 'long'>('short');
234
-
235
- useEffect(() => {
236
- // Determine A/B test variant
237
- const testVariant = await getABTestVariant('paywall_feedback');
238
- setVariant(testVariant);
239
- }, []);
240
-
241
- return (
242
- <PaywallFeedbackModal
243
- visible={showFeedback}
244
- onClose={() => setShowFeedback(false)}
245
- onSubmit={(reason) => {
246
- analytics.track('paywall_feedback', {
247
- reason,
248
- variant,
249
- abTest: 'paywall_feedback_v1',
250
- });
251
- setShowFeedback(false);
252
- }}
253
- title={
254
- variant === 'short'
255
- ? 'Quick Feedback'
256
- : 'Help Us Improve Our Premium'
257
- }
258
- subtitle={
259
- variant === 'short'
260
- ? 'Why not today?'
261
- : 'We\'d love to know why you\'re not upgrading'
262
- }
263
- submitText={
264
- variant === 'short'
265
- ? 'Send'
266
- : 'Submit Feedback'
267
- }
268
- />
269
- );
270
- }
271
- ```
272
-
273
- ## Modal Layout
274
-
275
- ```
276
- ┌─────────────────────────────────┐
277
- │ │
278
- │ Help Us Improve │
279
- │ Why are you not upgrading? │
280
- │ │
281
- ├─────────────────────────────────┤
282
- │ ○ Too expensive │
283
- │ ○ Don't need it right now │
284
- │ ○ Just trying out the app │
285
- │ ○ Technical issues │
286
- │ ○ Other │
287
- │ │
288
- │ [Text input for Other] │
289
- │ │
290
- ├─────────────────────────────────┤
291
- │ [Send Feedback] │
292
- └─────────────────────────────────┘
293
- ```
294
-
295
- ## Best Practices
296
-
297
- 1. **Track feedback** - Send analytics with feedback data
298
- 2. **Show sparingly** - Don't overwhelm users with feedback requests
299
- 3. **Keep optional** - Allow users to skip feedback
300
- 4. **Use data wisely** - Analyze feedback to improve paywall
301
- 5. **Test timing** - Find optimal moment to show feedback
302
- 6. **Localize content** - Translate all strings for i18n
303
- 7. **Keep simple** - Don't ask for too much information
304
-
305
- ## Related Hooks
306
-
307
- - **usePaywallFeedback** - Hook for feedback logic
308
- - **usePaywall** - For paywall state management
309
- - **usePaywallVisibility** - For paywall visibility
310
-
311
- ## See Also
312
-
313
- - [Paywall Screen](../../screens/README.md)
314
- - [Feedback Utilities](../../hooks/feedback/usePaywallFeedback.md)
87
+ - **PaywallModal**: Paywall modal component
88
+ - **usePaywall**: Paywall state management
89
+ - **Feedback README**: `./README.md`
90
+ - **Paywall README**: `../paywall/README.md`