@umituz/react-native-subscription 2.14.55 → 2.14.56

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.14.55",
3
+ "version": "2.14.56",
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",
@@ -4,12 +4,13 @@
4
4
  * Main app only needs to add this ONE component
5
5
  */
6
6
 
7
- import React, { useCallback } from "react";
7
+ import React, { useCallback, useEffect } from "react";
8
8
  import type { PurchasesPackage } from "react-native-purchases";
9
9
  import { usePaywallVisibility } from "../../../presentation/hooks/usePaywallVisibility";
10
10
  import { useSubscriptionPackages } from "../../../revenuecat/presentation/hooks/useSubscriptionPackages";
11
11
  import { usePurchasePackage } from "../../../revenuecat/presentation/hooks/usePurchasePackage";
12
12
  import { useRestorePurchase } from "../../../revenuecat/presentation/hooks/useRestorePurchase";
13
+ import { SubscriptionManager } from "../../../revenuecat/infrastructure/managers/SubscriptionManager";
13
14
  import { PaywallModal } from "./PaywallModal";
14
15
  import type { PaywallContainerProps } from "./PaywallContainer.types";
15
16
 
@@ -28,10 +29,25 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = ({
28
29
  onPurchaseError,
29
30
  }) => {
30
31
  const { showPaywall, closePaywall } = usePaywallVisibility();
31
- const { data: packages = [], isLoading } = useSubscriptionPackages(userId ?? undefined);
32
+ const { data: packages = [], isLoading, isFetching, status, error } = useSubscriptionPackages(userId ?? undefined);
32
33
  const { mutateAsync: purchasePackage } = usePurchasePackage(userId ?? undefined);
33
34
  const { mutateAsync: restorePurchases } = useRestorePurchase(userId ?? undefined);
34
35
 
36
+ useEffect(() => {
37
+ if (__DEV__ && showPaywall) {
38
+ console.log("[PaywallContainer] Paywall opened:", {
39
+ userId,
40
+ isConfigured: SubscriptionManager.isConfigured(),
41
+ isInitialized: SubscriptionManager.isInitialized(),
42
+ packagesCount: packages.length,
43
+ isLoading,
44
+ isFetching,
45
+ status,
46
+ error: error?.message ?? null,
47
+ });
48
+ }
49
+ }, [showPaywall, userId, packages.length, isLoading, isFetching, status, error]);
50
+
35
51
  const handlePurchase = useCallback(
36
52
  async (pkg: PurchasesPackage) => {
37
53
  try {