@umituz/react-native-subscription 2.14.98 → 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 -395
- 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 +52 -0
- package/src/domains/README.md.bak +274 -0
- package/src/domains/config/README.md +93 -383
- package/src/domains/config/domain/README.md +37 -0
- package/src/domains/config/domain/entities/README.md +41 -0
- 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 +96 -156
- 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 +43 -0
- package/src/revenuecat/application/ports/README.md +41 -0
- package/src/revenuecat/domain/README.md +42 -141
- package/src/revenuecat/domain/constants/README.md +41 -0
- package/src/revenuecat/domain/entities/README.md +42 -0
- package/src/revenuecat/domain/errors/README.md +47 -191
- package/src/revenuecat/domain/types/README.md +41 -0
- package/src/revenuecat/domain/value-objects/README.md +41 -0
- package/src/revenuecat/infrastructure/README.md +41 -0
- package/src/revenuecat/infrastructure/config/README.md +32 -23
- package/src/revenuecat/infrastructure/handlers/README.md +41 -0
- package/src/revenuecat/infrastructure/managers/README.md +34 -42
- package/src/revenuecat/infrastructure/services/README.md +42 -0
- package/src/revenuecat/infrastructure/utils/README.md +41 -0
- package/src/revenuecat/presentation/README.md +42 -0
- package/src/revenuecat/presentation/hooks/README.md +29 -35
- package/src/utils/README.md +38 -525
|
@@ -2,193 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
Tam ekran UI bileşenleri ve ekranlar.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
Abonelik detaylarını
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
###
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- Yönetilebilir stil
|
|
54
|
-
|
|
55
|
-
## Ekran Akışları
|
|
56
|
-
|
|
57
|
-
### 1. Settings → Subscription Detail
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
function SettingsScreen({ navigation }) {
|
|
61
|
-
return (
|
|
62
|
-
<View>
|
|
63
|
-
<Button
|
|
64
|
-
onPress={() => navigation.navigate('SubscriptionDetail')}
|
|
65
|
-
title="Manage Subscription"
|
|
66
|
-
/>
|
|
67
|
-
</View>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### 2. Paywall → Subscription Detail
|
|
73
|
-
|
|
74
|
-
```typescript
|
|
75
|
-
function PaywallFlow() {
|
|
76
|
-
const navigation = useNavigation();
|
|
77
|
-
|
|
78
|
-
const handlePurchaseSuccess = () => {
|
|
79
|
-
navigation.navigate('SubscriptionDetail');
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<PaywallModal onPurchase={handlePurchaseSuccess} />
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Özelleştirme
|
|
89
|
-
|
|
90
|
-
### Custom Header
|
|
91
|
-
|
|
92
|
-
```typescript
|
|
93
|
-
<Stack.Screen
|
|
94
|
-
name="SubscriptionDetail"
|
|
95
|
-
component={SubscriptionDetailScreen}
|
|
96
|
-
options={{
|
|
97
|
-
title: 'My Subscription',
|
|
98
|
-
headerStyle: {
|
|
99
|
-
backgroundColor: '#FF6B6B',
|
|
100
|
-
},
|
|
101
|
-
headerTintColor: '#fff',
|
|
102
|
-
headerTitleStyle: {
|
|
103
|
-
fontWeight: 'bold',
|
|
104
|
-
},
|
|
105
|
-
}}
|
|
106
|
-
/>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Navigation Integrasyonu
|
|
110
|
-
|
|
111
|
-
```typescript
|
|
112
|
-
import { createStackNavigator } from '@react-navigation/stack';
|
|
113
|
-
|
|
114
|
-
const Stack = createStackNavigator();
|
|
115
|
-
|
|
116
|
-
function SubscriptionStack() {
|
|
117
|
-
return (
|
|
118
|
-
<Stack.Navigator>
|
|
119
|
-
<Stack.Screen
|
|
120
|
-
name="SubscriptionDetail"
|
|
121
|
-
component={SubscriptionDetailScreen}
|
|
122
|
-
options={{
|
|
123
|
-
title: 'Subscription',
|
|
124
|
-
headerRight: () => (
|
|
125
|
-
<Button onPress={handleRefresh} title="Refresh" />
|
|
126
|
-
),
|
|
127
|
-
}}
|
|
128
|
-
/>
|
|
129
|
-
</Stack.Navigator>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## Örnek Implementasyon
|
|
135
|
-
|
|
136
|
-
```typescript
|
|
137
|
-
import React from 'react';
|
|
138
|
-
import { createStackNavigator } from '@react-navigation/stack';
|
|
139
|
-
import { SubscriptionDetailScreen } from '@umituz/react-native-subscription';
|
|
140
|
-
|
|
141
|
-
const Stack = createStackNavigator();
|
|
142
|
-
|
|
143
|
-
function App() {
|
|
144
|
-
return (
|
|
145
|
-
<NavigationContainer>
|
|
146
|
-
<Stack.Navigator
|
|
147
|
-
screenOptions={{
|
|
148
|
-
headerShown: true,
|
|
149
|
-
cardStyle: { backgroundColor: '#f5f5f5' },
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
152
|
-
<Stack.Screen
|
|
153
|
-
name="Home"
|
|
154
|
-
component={HomeScreen}
|
|
155
|
-
options={{ title: 'Home' }}
|
|
156
|
-
/>
|
|
157
|
-
<Stack.Screen
|
|
158
|
-
name="SubscriptionDetail"
|
|
159
|
-
component={SubscriptionDetailScreen}
|
|
160
|
-
options={{
|
|
161
|
-
title: 'My Subscription',
|
|
162
|
-
headerStyle: {
|
|
163
|
-
backgroundColor: '#FF6B6B',
|
|
164
|
-
},
|
|
165
|
-
headerTintColor: '#fff',
|
|
166
|
-
}}
|
|
167
|
-
/>
|
|
168
|
-
</Stack.Navigator>
|
|
169
|
-
</NavigationContainer>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function HomeScreen({ navigation }) {
|
|
174
|
-
const { isPremium } = usePremium();
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<View>
|
|
178
|
-
<Text>Welcome!</Text>
|
|
179
|
-
<Button
|
|
180
|
-
onPress={() => navigation.navigate('SubscriptionDetail')}
|
|
181
|
-
title="View Subscription"
|
|
182
|
-
/>
|
|
183
|
-
</View>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
## Best Practices
|
|
189
|
-
|
|
190
|
-
1. **Navigation**: Screen'i doğru navigation stack'e ekleyin
|
|
191
|
-
2. **Header**: Uygun başlık ve stiller kullanın
|
|
192
|
-
3. **Back Button**: Kullanıcının geri dönmesini sağlayın
|
|
193
|
-
4. **Loading**: Yükleme durumlarını gösterin
|
|
194
|
-
5. **Error**: Hata durumlarını graceful handle edin
|
|
5
|
+
## Location
|
|
6
|
+
|
|
7
|
+
`src/presentation/screens/`
|
|
8
|
+
|
|
9
|
+
## Strategy
|
|
10
|
+
|
|
11
|
+
Tam ekran kullanıcı arayüzü bileşenleri ve navigasyon akışlarını içerir. Abonelik detaylarını gösterir ve yönetim işlevleri sağlar.
|
|
12
|
+
|
|
13
|
+
## Restrictions
|
|
14
|
+
|
|
15
|
+
### REQUIRED
|
|
16
|
+
|
|
17
|
+
- MUST integrate properly with React Navigation
|
|
18
|
+
- MUST provide appropriate headers and navigation
|
|
19
|
+
- MUST handle loading states gracefully
|
|
20
|
+
- MUST handle error states gracefully
|
|
21
|
+
- MUST support back navigation
|
|
22
|
+
- MUST be responsive across different screen sizes
|
|
23
|
+
|
|
24
|
+
### PROHIBITED
|
|
25
|
+
|
|
26
|
+
- MUST NOT bypass navigation stack
|
|
27
|
+
- MUST NOT create navigation dead-ends
|
|
28
|
+
- MUST NOT block user from navigating away
|
|
29
|
+
- MUST NOT hardcode navigation routes
|
|
30
|
+
|
|
31
|
+
### CRITICAL
|
|
32
|
+
|
|
33
|
+
- Always provide clear navigation paths
|
|
34
|
+
- Handle all loading and error states
|
|
35
|
+
- Ensure proper back button functionality
|
|
36
|
+
- Support deep linking when applicable
|
|
37
|
+
- Maintain consistent styling with rest of app
|
|
38
|
+
|
|
39
|
+
## AI Agent Guidelines
|
|
40
|
+
|
|
41
|
+
When working with screens:
|
|
42
|
+
1. Navigation - screen'i doğru navigation stack'e ekleyin
|
|
43
|
+
2. Header - uygun başlık ve stiller kullanın
|
|
44
|
+
3. Back Button - kullanıcının geri dönmesini sağlayın
|
|
45
|
+
4. Loading - yükleme durumlarını gösterin
|
|
46
|
+
5. Error - hata durumlarını graceful handle edin
|
|
47
|
+
|
|
48
|
+
## Related Documentation
|
|
49
|
+
|
|
50
|
+
- [Presentation Layer](../README.md)
|
|
51
|
+
- [Components](../components/README.md)
|
|
52
|
+
- [Hooks](../hooks/README.md)
|
|
@@ -16,22 +16,6 @@ This directory contains all type definitions used by presentation components and
|
|
|
16
16
|
|
|
17
17
|
## Key Exports
|
|
18
18
|
|
|
19
|
-
```typescript
|
|
20
|
-
// Subscription Settings
|
|
21
|
-
export type {
|
|
22
|
-
SubscriptionSettingsConfig,
|
|
23
|
-
SubscriptionSettingsItemConfig,
|
|
24
|
-
SubscriptionSettingsTranslations,
|
|
25
|
-
} from './SubscriptionSettingsTypes';
|
|
26
|
-
|
|
27
|
-
// Paywall
|
|
28
|
-
export type {
|
|
29
|
-
PaywallConfig,
|
|
30
|
-
PaywallTrigger,
|
|
31
|
-
PaywallPackage,
|
|
32
|
-
} from './PaywallTypes';
|
|
33
|
-
```
|
|
34
|
-
|
|
35
19
|
## Related
|
|
36
20
|
|
|
37
21
|
- [Hooks](../hooks/README.md)
|
|
@@ -17,35 +17,14 @@ This directory contains utility functions used by presentation components and ho
|
|
|
17
17
|
|
|
18
18
|
Format ISO date string to localized date string.
|
|
19
19
|
|
|
20
|
-
```typescript
|
|
21
|
-
formatDate('2024-01-15T10:30:00Z'); // "January 15, 2024"
|
|
22
|
-
```
|
|
23
|
-
|
|
24
20
|
### calculateDaysRemaining
|
|
25
21
|
|
|
26
22
|
Calculate days between now and expiration date.
|
|
27
23
|
|
|
28
|
-
```typescript
|
|
29
|
-
calculateDaysRemaining('2024-02-15T10:30:00Z'); // 31
|
|
30
|
-
```
|
|
31
|
-
|
|
32
24
|
### convertPurchasedAt
|
|
33
25
|
|
|
34
26
|
Convert purchasedAt date to ISO string.
|
|
35
27
|
|
|
36
|
-
```typescript
|
|
37
|
-
convertPurchasedAt(new Date()); // "2024-01-15T10:30:00Z"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Usage
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
import { formatDate, calculateDaysRemaining } from '../utils/subscriptionDateUtils';
|
|
44
|
-
|
|
45
|
-
const expirationDisplay = formatDate(subscription.expirationDate);
|
|
46
|
-
const daysLeft = calculateDaysRemaining(subscription.expirationDate);
|
|
47
|
-
```
|
|
48
|
-
|
|
49
28
|
## Related
|
|
50
29
|
|
|
51
30
|
- [Hooks](../hooks/README.md)
|