@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.
- package/README.md +211 -394
- package/package.json +1 -1
- package/src/application/README.md +46 -225
- package/src/application/ports/README.md +42 -97
- package/src/domain/README.md +36 -384
- package/src/domain/constants/README.md +0 -56
- package/src/domain/entities/README.md +43 -169
- package/src/domain/errors/README.md +33 -287
- package/src/domain/value-objects/README.md +43 -179
- package/src/domains/README.md +50 -238
- package/src/domains/README.md.bak +274 -0
- package/src/domains/config/README.md +93 -383
- package/src/domains/config/domain/README.md +23 -376
- package/src/domains/config/domain/entities/README.md +34 -343
- package/src/domains/paywall/README.md +99 -369
- package/src/domains/paywall/components/README.md +34 -178
- package/src/domains/paywall/entities/README.md +34 -193
- package/src/domains/paywall/hooks/README.md +34 -122
- package/src/domains/wallet/README.md +34 -275
- package/src/domains/wallet/README.md.bak +209 -0
- package/src/domains/wallet/domain/README.md +34 -101
- package/src/domains/wallet/domain/entities/README.md +34 -115
- package/src/domains/wallet/domain/errors/README.md +34 -151
- package/src/domains/wallet/infrastructure/README.md +34 -89
- package/src/domains/wallet/presentation/components/README.md +34 -224
- package/src/domains/wallet/presentation/hooks/README.md +34 -248
- package/src/infrastructure/README.md +37 -496
- package/src/infrastructure/mappers/README.md +0 -13
- package/src/infrastructure/repositories/README.md +74 -360
- package/src/infrastructure/services/README.md +95 -370
- package/src/presentation/README.md +123 -408
- package/src/presentation/README.md.bak +172 -0
- package/src/presentation/components/README.md +151 -179
- package/src/presentation/components/README.md.bak +217 -0
- package/src/presentation/components/details/CreditRow.md +65 -310
- package/src/presentation/components/details/DetailRow.md +63 -255
- package/src/presentation/components/details/PremiumDetailsCard.md +65 -238
- package/src/presentation/components/details/PremiumStatusBadge.md +64 -239
- package/src/presentation/components/details/README.md +97 -447
- package/src/presentation/components/feedback/PaywallFeedbackModal.md +63 -287
- package/src/presentation/components/feedback/README.md +97 -445
- package/src/presentation/components/paywall/PaywallModal.md +66 -416
- package/src/presentation/components/paywall/README.md +50 -186
- package/src/presentation/components/sections/README.md +97 -466
- package/src/presentation/components/sections/SubscriptionSection.md +92 -244
- package/src/presentation/hooks/README.md +154 -741
- package/src/presentation/hooks/useAuthAwarePurchase.md +58 -325
- package/src/presentation/hooks/useAuthGate.md +61 -375
- package/src/presentation/hooks/useAuthSubscriptionSync.md +66 -370
- package/src/presentation/hooks/useCreditChecker.md +73 -378
- package/src/presentation/hooks/useCredits.md +74 -313
- package/src/presentation/hooks/useCredits.md.bak +231 -0
- package/src/presentation/hooks/useCreditsGate.md +66 -318
- package/src/presentation/hooks/useDeductCredit.md +0 -76
- package/src/presentation/hooks/useDevTestCallbacks.md +63 -394
- package/src/presentation/hooks/useFeatureGate.md +105 -150
- package/src/presentation/hooks/useFeatureGate.md.bak +284 -0
- package/src/presentation/hooks/useInitializeCredits.md +64 -430
- package/src/presentation/hooks/usePaywall.md +61 -306
- package/src/presentation/hooks/usePaywallOperations.md +64 -458
- package/src/presentation/hooks/usePaywallVisibility.md +67 -316
- package/src/presentation/hooks/usePremium.md +84 -226
- package/src/presentation/hooks/usePremiumGate.md +60 -395
- package/src/presentation/hooks/usePremiumWithCredits.md +64 -401
- package/src/presentation/hooks/useSubscription.md +66 -422
- package/src/presentation/hooks/useSubscriptionDetails.md +65 -410
- package/src/presentation/hooks/useSubscriptionGate.md +80 -164
- package/src/presentation/hooks/useSubscriptionSettingsConfig.md +66 -346
- package/src/presentation/hooks/useSubscriptionStatus.md +66 -396
- package/src/presentation/hooks/useUserTier.md +63 -328
- package/src/presentation/hooks/useUserTierWithRepository.md +64 -424
- package/src/presentation/screens/README.md +48 -190
- package/src/presentation/types/README.md +0 -16
- package/src/presentation/utils/README.md +0 -21
- package/src/revenuecat/README.md +99 -518
- package/src/revenuecat/application/README.md +35 -150
- package/src/revenuecat/application/ports/README.md +34 -162
- package/src/revenuecat/domain/README.md +42 -141
- package/src/revenuecat/domain/constants/README.md +34 -176
- package/src/revenuecat/domain/entities/README.md +34 -374
- package/src/revenuecat/domain/errors/README.md +47 -191
- package/src/revenuecat/domain/types/README.md +34 -366
- package/src/revenuecat/domain/value-objects/README.md +34 -434
- package/src/revenuecat/infrastructure/README.md +34 -43
- package/src/revenuecat/infrastructure/config/README.md +32 -23
- package/src/revenuecat/infrastructure/handlers/README.md +34 -211
- package/src/revenuecat/infrastructure/managers/README.md +34 -42
- package/src/revenuecat/infrastructure/services/README.md +35 -318
- package/src/revenuecat/infrastructure/utils/README.md +34 -375
- package/src/revenuecat/presentation/README.md +34 -176
- package/src/revenuecat/presentation/hooks/README.md +29 -35
- package/src/utils/README.md +38 -525
|
@@ -1,314 +1,90 @@
|
|
|
1
1
|
# PaywallFeedbackModal Component
|
|
2
2
|
|
|
3
|
-
Modal for collecting user feedback
|
|
3
|
+
Modal component for collecting user feedback after paywall dismissal.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Location
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import { PaywallFeedbackModal } from '@umituz/react-native-subscription';
|
|
9
|
-
```
|
|
7
|
+
**Import Path**: `@umituz/react-native-subscription`
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
**File**: `src/presentation/components/feedback/PaywallFeedbackModal.tsx`
|
|
12
10
|
|
|
13
|
-
|
|
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
|
-
##
|
|
13
|
+
## Strategy
|
|
26
14
|
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
40
|
-
function PaywallScreen() {
|
|
41
|
-
const [showFeedback, setShowFeedback] = useState(false);
|
|
24
|
+
### Integration Points
|
|
42
25
|
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
48
|
-
analytics.track('paywall_feedback', { reason });
|
|
49
|
-
setShowFeedback(false);
|
|
50
|
-
navigation.goBack();
|
|
51
|
-
};
|
|
31
|
+
## Restrictions
|
|
52
32
|
|
|
53
|
-
|
|
54
|
-
<View>
|
|
55
|
-
<PaywallContent onClose={handleClose} />
|
|
33
|
+
### REQUIRED
|
|
56
34
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
40
|
+
### PROHIBITED
|
|
68
41
|
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
function CustomFeedbackModal() {
|
|
73
|
-
const [visible, setVisible] = useState(false);
|
|
47
|
+
### CRITICAL SAFETY
|
|
74
48
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
54
|
+
## AI Agent Guidelines
|
|
93
55
|
|
|
94
|
-
|
|
95
|
-
function TrackedFeedbackModal() {
|
|
96
|
-
const [visible, setVisible] = useState(false);
|
|
97
|
-
const [paywallTrigger] = useState('premium_feature');
|
|
56
|
+
### When Implementing Feedback Modals
|
|
98
57
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
107
|
-
api.trackFeedback({
|
|
108
|
-
type: 'paywall_decline',
|
|
109
|
-
reason,
|
|
110
|
-
context: { trigger: paywallTrigger },
|
|
111
|
-
});
|
|
64
|
+
### Integration Checklist
|
|
112
65
|
|
|
113
|
-
|
|
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
|
-
|
|
117
|
-
<PaywallFeedbackModal
|
|
118
|
-
visible={visible}
|
|
119
|
-
onClose={() => setVisible(false)}
|
|
120
|
-
onSubmit={handleSubmit}
|
|
121
|
-
/>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
```
|
|
77
|
+
### Common Patterns
|
|
125
78
|
|
|
126
|
-
|
|
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
|
-
|
|
129
|
-
function ConditionalFeedback() {
|
|
130
|
-
const [showFeedback, setShowFeedback] = useState(false);
|
|
131
|
-
const [hasSeenFeedback, setHasSeenFeedback] = useState(false);
|
|
85
|
+
## Related Documentation
|
|
132
86
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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`
|