@umituz/react-native-subscription 2.26.18 → 2.26.19
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.26.
|
|
3
|
+
"version": "2.26.19",
|
|
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",
|
|
@@ -57,13 +57,25 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = (props) => {
|
|
|
57
57
|
if (!trialConfig?.enabled) return;
|
|
58
58
|
if (allPackages.length === 0) return;
|
|
59
59
|
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
const productIds = trialConfig.eligibleProductIds?.length
|
|
63
|
-
? [...trialConfig.eligibleProductIds]
|
|
64
|
-
: allPackages.map((pkg) => pkg.product.identifier);
|
|
60
|
+
// Get all actual product IDs from packages
|
|
61
|
+
const allProductIds = allPackages.map((pkg) => pkg.product.identifier);
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
// If eligibleProductIds are provided, filter to matching packages (partial match)
|
|
64
|
+
// e.g., "yearly" matches "futureus.yearly"
|
|
65
|
+
let productIdsToCheck: string[];
|
|
66
|
+
if (trialConfig.eligibleProductIds?.length) {
|
|
67
|
+
productIdsToCheck = allProductIds.filter((actualId) =>
|
|
68
|
+
trialConfig.eligibleProductIds?.some((configId) =>
|
|
69
|
+
actualId.toLowerCase().includes(configId.toLowerCase())
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
} else {
|
|
73
|
+
productIdsToCheck = allProductIds;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (productIdsToCheck.length > 0) {
|
|
77
|
+
checkEligibility(productIdsToCheck);
|
|
78
|
+
}
|
|
67
79
|
}, [allPackages, checkEligibility, trialConfig?.enabled, trialConfig?.eligibleProductIds]);
|
|
68
80
|
|
|
69
81
|
// Convert eligibility map to format expected by PaywallModal
|