@umituz/react-native-subscription 2.13.14 → 2.13.16
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.13.
|
|
3
|
+
"version": "2.13.16",
|
|
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",
|
|
@@ -56,6 +56,17 @@ export const PaywallModal: React.FC<PaywallModalProps> = React.memo((props) => {
|
|
|
56
56
|
const showCredits = mode === "credits";
|
|
57
57
|
const showSubscription = mode === "subscription" || mode === "hybrid";
|
|
58
58
|
|
|
59
|
+
// Debug logging for credit amounts
|
|
60
|
+
if (__DEV__ && visible && showSubscription) {
|
|
61
|
+
console.log("[PaywallModal] Credit amounts debug:", {
|
|
62
|
+
creditAmountsKeys: creditAmounts ? Object.keys(creditAmounts) : [],
|
|
63
|
+
creditAmountsValues: creditAmounts,
|
|
64
|
+
creditsLabel,
|
|
65
|
+
packagesCount: subscriptionPackages.length,
|
|
66
|
+
packageIdentifiers: subscriptionPackages.map(p => p.product?.identifier),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
const handlePurchase = useCallback(async () => {
|
|
60
71
|
setIsProcessing(true);
|
|
61
72
|
try {
|
|
@@ -97,18 +97,52 @@ export function createCreditAmountsFromPackages(
|
|
|
97
97
|
): Record<string, number> {
|
|
98
98
|
const result: Record<string, number> = {};
|
|
99
99
|
|
|
100
|
+
if (__DEV__) {
|
|
101
|
+
console.log("[CreditMapper] Input packages count:", packages?.length || 0);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!packages || packages.length === 0) {
|
|
105
|
+
if (__DEV__) {
|
|
106
|
+
console.log("[CreditMapper] No packages provided, returning empty object");
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
for (const pkg of packages) {
|
|
101
|
-
const identifier = pkg
|
|
112
|
+
const identifier = pkg?.product?.identifier;
|
|
113
|
+
|
|
114
|
+
if (__DEV__) {
|
|
115
|
+
console.log("[CreditMapper] Processing package:", {
|
|
116
|
+
hasProduct: !!pkg?.product,
|
|
117
|
+
identifier,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (!identifier) {
|
|
122
|
+
if (__DEV__) {
|
|
123
|
+
console.warn("[CreditMapper] Package missing product.identifier:", pkg);
|
|
124
|
+
}
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
102
128
|
const packageType = detectPackageType(identifier);
|
|
103
129
|
const credits = getImageCreditsForPackage(packageType);
|
|
104
130
|
|
|
131
|
+
if (__DEV__) {
|
|
132
|
+
console.log("[CreditMapper] Package mapping:", {
|
|
133
|
+
identifier,
|
|
134
|
+
packageType,
|
|
135
|
+
credits,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
105
139
|
if (credits !== null) {
|
|
106
140
|
result[identifier] = credits;
|
|
107
141
|
}
|
|
108
142
|
}
|
|
109
143
|
|
|
110
144
|
if (__DEV__) {
|
|
111
|
-
console.log("[CreditMapper]
|
|
145
|
+
console.log("[CreditMapper] Final credit amounts:", result);
|
|
112
146
|
}
|
|
113
147
|
|
|
114
148
|
return result;
|