@umituz/react-native-subscription 2.27.63 → 2.27.64

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.27.63",
3
+ "version": "2.27.64",
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",
@@ -75,10 +75,6 @@ export interface CreditsConfig {
75
75
  creditPackageAmounts?: Record<string, number>;
76
76
  /** Credit allocations for different subscription types (weekly, monthly, yearly) */
77
77
  packageAllocations?: PackageAllocationMap;
78
- /** Whether to enable free credits for non-premium users */
79
- enableFreeCredits?: boolean;
80
- /** Number of free credits given to non-premium users */
81
- freeCredits?: number;
82
78
  }
83
79
 
84
80
  export interface CreditsResult<T = UserCredits> {
@@ -7,7 +7,6 @@ export const SUBSCRIPTION_STATUS = {
7
7
  EXPIRED: 'expired',
8
8
  CANCELED: 'canceled',
9
9
  NONE: 'none',
10
- FREE: 'free',
11
10
  } as const;
12
11
 
13
12
  /** RevenueCat period type constants */
@@ -99,12 +99,6 @@ export const initializeSubscription = async (config: SubscriptionInitConfig): Pr
99
99
  ) => {
100
100
  if (__DEV__) console.log('[SubscriptionInitializer] onPremiumStatusChanged:', { userId, isPremium, productId, willRenew, periodType });
101
101
  try {
102
- // If not premium and no productId, this is a free user - don't overwrite free credits
103
- if (!isPremium && !productId) {
104
- if (__DEV__) console.log('[SubscriptionInitializer] Free user detected, preserving free credits');
105
- return;
106
- }
107
-
108
102
  // If premium became false, check if actually expired or just canceled
109
103
  if (!isPremium && productId) {
110
104
  const isActuallyExpired = !expiresAt || new Date(expiresAt) < new Date();
@@ -6,7 +6,7 @@
6
6
  /** Trial constants */
7
7
  export const TRIAL_CONFIG = {
8
8
  DURATION_DAYS: 3,
9
- CREDITS: 5,
9
+ CREDITS: 0,
10
10
  } as const;
11
11
 
12
12
  /** Device trial record in Firestore */
@@ -43,24 +43,12 @@ export const PremiumDetailsCard: React.FC<PremiumDetailsCardProps> = ({
43
43
  status={statusType}
44
44
  activeLabel={translations.statusActive}
45
45
  expiredLabel={translations.statusExpired}
46
- noneLabel={translations.statusFree}
46
+ noneLabel={translations.statusInactive}
47
47
  canceledLabel={translations.statusCanceled}
48
48
  />
49
49
  </View>
50
50
  )}
51
51
 
52
- {!isPremium && !showCredits && (
53
- <View style={styles.freeUserHeader}>
54
- <View style={styles.freeUserTextContainer}>
55
- <AtomicText type="headlineSmall" style={{ color: tokens.colors.textPrimary, fontWeight: "700" }}>
56
- {translations.title}
57
- </AtomicText>
58
- <AtomicText type="bodyMedium" style={{ color: tokens.colors.textSecondary }}>
59
- {translations.freeDescription}
60
- </AtomicText>
61
- </View>
62
- </View>
63
- )}
64
52
 
65
53
  {isPremium && (
66
54
  <View style={styles.detailsSection}>
@@ -14,7 +14,6 @@ export interface CreditInfo {
14
14
 
15
15
  export interface PremiumDetailsTranslations {
16
16
  title: string;
17
- freeDescription?: string;
18
17
  statusLabel: string;
19
18
  expiresLabel: string;
20
19
  purchasedLabel: string;
@@ -25,7 +24,7 @@ export interface PremiumDetailsTranslations {
25
24
  lifetimeLabel?: string;
26
25
  statusActive: string;
27
26
  statusExpired: string;
28
- statusFree: string;
27
+ statusInactive: string;
29
28
  statusCanceled: string;
30
29
  }
31
30
 
@@ -16,12 +16,8 @@ export interface PremiumStatusBadgeProps {
16
16
  expiredLabel: string;
17
17
  noneLabel: string;
18
18
  canceledLabel: string;
19
- /** Label for trial status (defaults to activeLabel if not provided) */
20
- trialLabel?: string;
21
19
  /** Label for trial_canceled status (defaults to canceledLabel if not provided) */
22
20
  trialCanceledLabel?: string;
23
- /** Label for free credits status (defaults to noneLabel if not provided) */
24
- freeLabel?: string;
25
21
  }
26
22
 
27
23
  export const PremiumStatusBadge: React.FC<PremiumStatusBadgeProps> = ({
@@ -30,20 +26,17 @@ export const PremiumStatusBadge: React.FC<PremiumStatusBadgeProps> = ({
30
26
  expiredLabel,
31
27
  noneLabel,
32
28
  canceledLabel,
33
- trialLabel,
34
29
  trialCanceledLabel,
35
- freeLabel,
36
30
  }) => {
37
31
  const tokens = useAppDesignTokens();
38
32
 
39
33
  const labels: Record<SubscriptionStatusType, string> = {
40
34
  active: activeLabel,
41
- trial: trialLabel ?? activeLabel,
35
+ trial: activeLabel,
42
36
  trial_canceled: trialCanceledLabel ?? canceledLabel,
43
37
  expired: expiredLabel,
44
38
  none: noneLabel,
45
39
  canceled: canceledLabel,
46
- free: freeLabel ?? noneLabel,
47
40
  };
48
41
 
49
42
  const backgroundColor = useMemo(() => {
@@ -54,7 +47,6 @@ export const PremiumStatusBadge: React.FC<PremiumStatusBadgeProps> = ({
54
47
  expired: tokens.colors.error,
55
48
  none: tokens.colors.textTertiary,
56
49
  canceled: tokens.colors.warning,
57
- free: tokens.colors.info ?? tokens.colors.primary, // Blue for free credits
58
50
  };
59
51
  return colors[status];
60
52
  }, [status, tokens.colors]);
@@ -74,7 +74,7 @@ export const useSubscriptionSettingsConfig = (
74
74
  title: translations.title,
75
75
  description: translations.description,
76
76
  isPremium,
77
- statusLabel: isPremium ? translations.statusActive : translations.statusFree,
77
+ statusLabel: isPremium ? translations.statusActive : translations.statusInactive,
78
78
  icon: "diamond",
79
79
  onPress: handleOpenPaywall,
80
80
  },
@@ -93,7 +93,7 @@ export const useSubscriptionSettingsConfig = (
93
93
  statusLabel: translations.statusLabel,
94
94
  statusActive: translations.statusActive,
95
95
  statusExpired: translations.statusExpired,
96
- statusFree: translations.statusFree,
96
+ statusInactive: translations.statusInactive,
97
97
  statusCanceled: translations.statusCanceled,
98
98
  expiresLabel: translations.expiresLabel,
99
99
  purchasedLabel: translations.purchasedLabel,
@@ -14,7 +14,7 @@ export interface SubscriptionDetailTranslations {
14
14
  statusLabel: string;
15
15
  statusActive: string;
16
16
  statusExpired: string;
17
- statusFree: string;
17
+ statusInactive: string;
18
18
  statusCanceled: string;
19
19
  /** Trial status label (defaults to statusActive if not provided) */
20
20
  statusTrial?: string;
@@ -102,7 +102,7 @@ export interface SubscriptionHeaderProps {
102
102
  | "statusLabel"
103
103
  | "statusActive"
104
104
  | "statusExpired"
105
- | "statusFree"
105
+ | "statusInactive"
106
106
  | "statusCanceled"
107
107
  | "statusTrial"
108
108
  | "statusTrialCanceled"
@@ -39,7 +39,7 @@ export interface SubscriptionSettingsTranslations {
39
39
  description: string;
40
40
  /** Status labels */
41
41
  statusActive: string;
42
- statusFree: string;
42
+ statusInactive: string;
43
43
  statusExpired: string;
44
44
  statusCanceled: string;
45
45
  /** Trial status label (defaults to statusActive if not provided) */