@umituz/react-native-subscription 2.27.40 → 2.27.42
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.
|
|
3
|
+
"version": "2.27.42",
|
|
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",
|
|
@@ -24,6 +24,7 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = (props) => {
|
|
|
24
24
|
bestValueIdentifier,
|
|
25
25
|
creditsLabel,
|
|
26
26
|
creditAmounts,
|
|
27
|
+
packageAllocations,
|
|
27
28
|
packageFilterConfig,
|
|
28
29
|
source,
|
|
29
30
|
onPurchaseSuccess,
|
|
@@ -93,8 +94,10 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = (props) => {
|
|
|
93
94
|
|
|
94
95
|
const { filteredPackages, computedCreditAmounts } = useMemo(() => ({
|
|
95
96
|
filteredPackages: filterPackagesByMode(allPackages, mode, packageFilterConfig),
|
|
96
|
-
computedCreditAmounts: mode !== "subscription" && !creditAmounts
|
|
97
|
-
|
|
97
|
+
computedCreditAmounts: mode !== "subscription" && !creditAmounts
|
|
98
|
+
? createCreditAmountsFromPackages(allPackages, packageAllocations)
|
|
99
|
+
: creditAmounts
|
|
100
|
+
}), [allPackages, mode, packageFilterConfig, creditAmounts, packageAllocations]);
|
|
98
101
|
|
|
99
102
|
if (!isVisible) return null;
|
|
100
103
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type { ImageSourcePropType } from "react-native";
|
|
7
7
|
import type { PaywallMode, PaywallTranslations, PaywallLegalUrls, SubscriptionFeature } from "../entities";
|
|
8
8
|
import type { PackageFilterConfig } from "../../../utils/packageFilter";
|
|
9
|
-
import type { PurchaseSource } from "../../../domain/entities/Credits";
|
|
9
|
+
import type { PurchaseSource, PackageAllocationMap } from "../../../domain/entities/Credits";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Trial display configuration
|
|
@@ -40,6 +40,8 @@ export interface PaywallContainerProps {
|
|
|
40
40
|
readonly creditsLabel?: string;
|
|
41
41
|
/** Credit amounts per package identifier */
|
|
42
42
|
readonly creditAmounts?: Record<string, number>;
|
|
43
|
+
/** Package allocations for automatic credit amount computation */
|
|
44
|
+
readonly packageAllocations?: PackageAllocationMap;
|
|
43
45
|
/** Custom filter config for package categorization */
|
|
44
46
|
readonly packageFilterConfig?: PackageFilterConfig;
|
|
45
47
|
/** Source of the paywall - affects pending purchase handling */
|