@umituz/react-native-subscription 2.28.5 → 2.29.0
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 +1 -1
- package/src/domains/subscription/presentation/screens/SubscriptionDetailScreen.tsx +8 -0
- package/src/domains/subscription/presentation/screens/SubscriptionDetailScreen.types.ts +19 -0
- package/src/domains/subscription/presentation/screens/components/SubscriptionHeader.tsx +16 -0
- package/src/domains/subscription/presentation/screens/components/SubscriptionHeader.types.ts +18 -0
- package/src/domains/subscription/presentation/screens/components/SubscriptionHeaderContent.tsx +90 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.29.0",
|
|
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",
|
|
@@ -51,6 +51,14 @@ export const SubscriptionDetailScreen: React.FC<SubscriptionDetailScreenProps> =
|
|
|
51
51
|
daysRemaining={config.daysRemaining}
|
|
52
52
|
hideTitle={!!config.onClose}
|
|
53
53
|
translations={config.translations}
|
|
54
|
+
willRenew={config.willRenew}
|
|
55
|
+
productIdentifier={config.productIdentifier}
|
|
56
|
+
periodType={config.periodType}
|
|
57
|
+
store={config.store}
|
|
58
|
+
originalPurchaseDate={config.originalPurchaseDate}
|
|
59
|
+
latestPurchaseDate={config.latestPurchaseDate}
|
|
60
|
+
billingIssuesDetected={config.billingIssuesDetected}
|
|
61
|
+
isSandbox={config.isSandbox}
|
|
54
62
|
/>
|
|
55
63
|
)}
|
|
56
64
|
{showCredits && config.credits && (
|
|
@@ -20,6 +20,16 @@ export interface SubscriptionDetailTranslations {
|
|
|
20
20
|
creditsResetInfo?: string;
|
|
21
21
|
remainingLabel?: string;
|
|
22
22
|
upgradeButton: string;
|
|
23
|
+
// Additional subscription details
|
|
24
|
+
willRenewLabel?: string;
|
|
25
|
+
productLabel?: string;
|
|
26
|
+
planTypeLabel?: string;
|
|
27
|
+
periodTypeLabel?: string;
|
|
28
|
+
storeLabel?: string;
|
|
29
|
+
originalPurchaseDateLabel?: string;
|
|
30
|
+
latestPurchaseDateLabel?: string;
|
|
31
|
+
billingIssuesLabel?: string;
|
|
32
|
+
sandboxLabel?: string;
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
export interface UpgradePromptConfig {
|
|
@@ -47,6 +57,15 @@ export interface SubscriptionDetailConfig {
|
|
|
47
57
|
translations: SubscriptionDetailTranslations;
|
|
48
58
|
upgradePrompt?: UpgradePromptConfig;
|
|
49
59
|
onClose?: () => void;
|
|
60
|
+
// Additional RevenueCat subscription details
|
|
61
|
+
willRenew?: boolean | null;
|
|
62
|
+
productIdentifier?: string | null;
|
|
63
|
+
periodType?: string | null;
|
|
64
|
+
store?: string | null;
|
|
65
|
+
originalPurchaseDate?: string | null;
|
|
66
|
+
latestPurchaseDate?: string | null;
|
|
67
|
+
billingIssuesDetected?: boolean;
|
|
68
|
+
isSandbox?: boolean;
|
|
50
69
|
}
|
|
51
70
|
|
|
52
71
|
export interface SubscriptionDetailScreenProps {
|
|
@@ -18,6 +18,14 @@ export const SubscriptionHeader: React.FC<SubscriptionHeaderProps> = ({
|
|
|
18
18
|
daysRemaining,
|
|
19
19
|
hideTitle,
|
|
20
20
|
translations,
|
|
21
|
+
willRenew,
|
|
22
|
+
productIdentifier,
|
|
23
|
+
periodType,
|
|
24
|
+
store,
|
|
25
|
+
originalPurchaseDate,
|
|
26
|
+
latestPurchaseDate,
|
|
27
|
+
billingIssuesDetected,
|
|
28
|
+
isSandbox,
|
|
21
29
|
}) => {
|
|
22
30
|
const tokens = useAppDesignTokens();
|
|
23
31
|
const showExpiring = daysRemaining !== null && daysRemaining !== undefined && daysRemaining <= EXPIRING_SOON_THRESHOLD_DAYS;
|
|
@@ -50,6 +58,14 @@ export const SubscriptionHeader: React.FC<SubscriptionHeaderProps> = ({
|
|
|
50
58
|
showExpiring={showExpiring}
|
|
51
59
|
translations={translations}
|
|
52
60
|
styles={styles}
|
|
61
|
+
willRenew={willRenew}
|
|
62
|
+
productIdentifier={productIdentifier}
|
|
63
|
+
periodType={periodType}
|
|
64
|
+
store={store}
|
|
65
|
+
originalPurchaseDate={originalPurchaseDate}
|
|
66
|
+
latestPurchaseDate={latestPurchaseDate}
|
|
67
|
+
billingIssuesDetected={billingIssuesDetected}
|
|
68
|
+
isSandbox={isSandbox}
|
|
53
69
|
/>
|
|
54
70
|
</View>
|
|
55
71
|
);
|
package/src/domains/subscription/presentation/screens/components/SubscriptionHeader.types.ts
CHANGED
|
@@ -16,5 +16,23 @@ export interface SubscriptionHeaderProps {
|
|
|
16
16
|
lifetimeLabel: string;
|
|
17
17
|
expiresLabel: string;
|
|
18
18
|
purchasedLabel: string;
|
|
19
|
+
willRenewLabel?: string;
|
|
20
|
+
productLabel?: string;
|
|
21
|
+
planTypeLabel?: string;
|
|
22
|
+
periodTypeLabel?: string;
|
|
23
|
+
storeLabel?: string;
|
|
24
|
+
originalPurchaseDateLabel?: string;
|
|
25
|
+
latestPurchaseDateLabel?: string;
|
|
26
|
+
billingIssuesLabel?: string;
|
|
27
|
+
sandboxLabel?: string;
|
|
19
28
|
};
|
|
29
|
+
// Additional RevenueCat subscription details
|
|
30
|
+
willRenew?: boolean | null;
|
|
31
|
+
productIdentifier?: string | null;
|
|
32
|
+
periodType?: string | null;
|
|
33
|
+
store?: string | null;
|
|
34
|
+
originalPurchaseDate?: string | null;
|
|
35
|
+
latestPurchaseDate?: string | null;
|
|
36
|
+
billingIssuesDetected?: boolean;
|
|
37
|
+
isSandbox?: boolean;
|
|
20
38
|
}
|
package/src/domains/subscription/presentation/screens/components/SubscriptionHeaderContent.tsx
CHANGED
|
@@ -11,6 +11,14 @@ interface SubscriptionHeaderContentProps {
|
|
|
11
11
|
showExpiring: boolean;
|
|
12
12
|
translations: SubscriptionHeaderProps["translations"];
|
|
13
13
|
styles: any;
|
|
14
|
+
willRenew?: boolean | null;
|
|
15
|
+
productIdentifier?: string | null;
|
|
16
|
+
periodType?: string | null;
|
|
17
|
+
store?: string | null;
|
|
18
|
+
originalPurchaseDate?: string | null;
|
|
19
|
+
latestPurchaseDate?: string | null;
|
|
20
|
+
billingIssuesDetected?: boolean;
|
|
21
|
+
isSandbox?: boolean;
|
|
14
22
|
}
|
|
15
23
|
|
|
16
24
|
export const SubscriptionHeaderContent: React.FC<SubscriptionHeaderContentProps> = ({
|
|
@@ -21,6 +29,14 @@ export const SubscriptionHeaderContent: React.FC<SubscriptionHeaderContentProps>
|
|
|
21
29
|
showExpiring,
|
|
22
30
|
translations,
|
|
23
31
|
styles,
|
|
32
|
+
willRenew,
|
|
33
|
+
productIdentifier,
|
|
34
|
+
periodType,
|
|
35
|
+
store,
|
|
36
|
+
originalPurchaseDate,
|
|
37
|
+
latestPurchaseDate,
|
|
38
|
+
billingIssuesDetected,
|
|
39
|
+
isSandbox,
|
|
24
40
|
}) => (
|
|
25
41
|
<View style={styles.details}>
|
|
26
42
|
{isLifetime ? (
|
|
@@ -52,6 +68,80 @@ export const SubscriptionHeaderContent: React.FC<SubscriptionHeaderContentProps>
|
|
|
52
68
|
valueStyle={styles.value}
|
|
53
69
|
/>
|
|
54
70
|
)}
|
|
71
|
+
{willRenew !== null && willRenew !== undefined && translations.willRenewLabel && (
|
|
72
|
+
<DetailRow
|
|
73
|
+
label={translations.willRenewLabel}
|
|
74
|
+
value={willRenew ? "Yes" : "No"}
|
|
75
|
+
highlight={!willRenew}
|
|
76
|
+
style={styles.row}
|
|
77
|
+
labelStyle={styles.label}
|
|
78
|
+
valueStyle={styles.value}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
{productIdentifier && translations.productLabel && (
|
|
82
|
+
<DetailRow
|
|
83
|
+
label={translations.productLabel}
|
|
84
|
+
value={productIdentifier}
|
|
85
|
+
style={styles.row}
|
|
86
|
+
labelStyle={styles.label}
|
|
87
|
+
valueStyle={styles.value}
|
|
88
|
+
/>
|
|
89
|
+
)}
|
|
90
|
+
{periodType && translations.periodTypeLabel && (
|
|
91
|
+
<DetailRow
|
|
92
|
+
label={translations.periodTypeLabel}
|
|
93
|
+
value={periodType}
|
|
94
|
+
style={styles.row}
|
|
95
|
+
labelStyle={styles.label}
|
|
96
|
+
valueStyle={styles.value}
|
|
97
|
+
/>
|
|
98
|
+
)}
|
|
99
|
+
{store && translations.storeLabel && (
|
|
100
|
+
<DetailRow
|
|
101
|
+
label={translations.storeLabel}
|
|
102
|
+
value={store}
|
|
103
|
+
style={styles.row}
|
|
104
|
+
labelStyle={styles.label}
|
|
105
|
+
valueStyle={styles.value}
|
|
106
|
+
/>
|
|
107
|
+
)}
|
|
108
|
+
{originalPurchaseDate && translations.originalPurchaseDateLabel && (
|
|
109
|
+
<DetailRow
|
|
110
|
+
label={translations.originalPurchaseDateLabel}
|
|
111
|
+
value={originalPurchaseDate}
|
|
112
|
+
style={styles.row}
|
|
113
|
+
labelStyle={styles.label}
|
|
114
|
+
valueStyle={styles.value}
|
|
115
|
+
/>
|
|
116
|
+
)}
|
|
117
|
+
{latestPurchaseDate && translations.latestPurchaseDateLabel && (
|
|
118
|
+
<DetailRow
|
|
119
|
+
label={translations.latestPurchaseDateLabel}
|
|
120
|
+
value={latestPurchaseDate}
|
|
121
|
+
style={styles.row}
|
|
122
|
+
labelStyle={styles.label}
|
|
123
|
+
valueStyle={styles.value}
|
|
124
|
+
/>
|
|
125
|
+
)}
|
|
126
|
+
{billingIssuesDetected && translations.billingIssuesLabel && (
|
|
127
|
+
<DetailRow
|
|
128
|
+
label={translations.billingIssuesLabel}
|
|
129
|
+
value="Detected"
|
|
130
|
+
highlight={true}
|
|
131
|
+
style={styles.row}
|
|
132
|
+
labelStyle={styles.label}
|
|
133
|
+
valueStyle={styles.value}
|
|
134
|
+
/>
|
|
135
|
+
)}
|
|
136
|
+
{isSandbox && translations.sandboxLabel && (
|
|
137
|
+
<DetailRow
|
|
138
|
+
label={translations.sandboxLabel}
|
|
139
|
+
value="Test Mode"
|
|
140
|
+
style={styles.row}
|
|
141
|
+
labelStyle={styles.label}
|
|
142
|
+
valueStyle={styles.value}
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
55
145
|
</>
|
|
56
146
|
)}
|
|
57
147
|
</View>
|