@umituz/react-native-subscription 2.27.81 → 2.27.83

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.81",
3
+ "version": "2.27.83",
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",
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import React, { useMemo, useEffect } from "react";
8
- import { usePaywallVisibility } from "../../../presentation/hooks/usePaywallVisibility";
8
+ import { usePaywallVisibility } from "../../subscription/presentation/usePaywallVisibility";
9
9
  import { useSubscriptionPackages } from "../../subscription/infrastructure/hooks/useSubscriptionPackages";
10
10
  import { useRevenueCatTrialEligibility } from "../../subscription/infrastructure/hooks/useRevenueCatTrialEligibility";
11
11
  import { createCreditAmountsFromPackages } from "../../../utils/creditMapper";
@@ -1,7 +1,7 @@
1
1
  import { useCallback } from "react";
2
2
  import type { PurchasesPackage } from "react-native-purchases";
3
3
  import { useRestorePurchase } from "../../subscription/infrastructure/hooks/useRestorePurchase";
4
- import { useAuthAwarePurchase } from "../../../presentation/hooks/useAuthAwarePurchase";
4
+ import { useAuthAwarePurchase } from "../../subscription/presentation/useAuthAwarePurchase";
5
5
  import type { PurchaseSource } from "../../credits/core/Credits";
6
6
 
7
7
  interface UsePaywallActionsProps {
@@ -14,7 +14,7 @@ import {
14
14
  } from "@umituz/react-native-auth";
15
15
  import { SubscriptionManager } from "../../infrastructure/managers/SubscriptionManager";
16
16
  import { SUBSCRIPTION_QUERY_KEYS } from "./subscriptionQueryKeys";
17
- import { creditsQueryKeys } from "../../../presentation/hooks/useCredits";
17
+ import { creditsQueryKeys } from "../../../credits/presentation/useCredits";
18
18
 
19
19
  /** Purchase mutation result - simplified for presentation layer */
20
20
  export interface PurchaseMutationResult {
@@ -12,7 +12,7 @@ import {
12
12
  } from "@umituz/react-native-auth";
13
13
  import { SubscriptionManager } from "../../infrastructure/managers/SubscriptionManager";
14
14
  import { SUBSCRIPTION_QUERY_KEYS } from "./subscriptionQueryKeys";
15
- import { creditsQueryKeys } from "../../../presentation/hooks/useCredits";
15
+ import { creditsQueryKeys } from "../../../credits/presentation/useCredits";
16
16
 
17
17
  interface RestoreResult {
18
18
  success: boolean;
@@ -4,7 +4,7 @@ import { RevenueCatPurchaseError, RevenueCatInitializationError } from "../../co
4
4
  import type { RevenueCatConfig } from "../../core/RevenueCatConfig";
5
5
  import { isUserCancelledError, getErrorMessage } from "../../core/RevenueCatTypes";
6
6
  import { syncPremiumStatus, notifyPurchaseCompleted } from "../utils/PremiumStatusSyncer";
7
- import { getSavedPurchase, clearSavedPurchase } from "../../../presentation/hooks/useAuthAwarePurchase";
7
+ import { getSavedPurchase, clearSavedPurchase } from "../../presentation/useAuthAwarePurchase";
8
8
 
9
9
  export interface PurchaseHandlerDeps {
10
10
  config: RevenueCatConfig;
@@ -47,16 +47,16 @@ export async function handlePurchase(
47
47
  await syncPremiumStatus(deps.config, userId, customerInfo);
48
48
  await notifyPurchaseCompleted(deps.config, userId, pkg.product.identifier, customerInfo, source);
49
49
  clearSavedPurchase();
50
- return { success: true, isPremium: true, customerInfo };
50
+ return { success: true, isPremium: true, customerInfo, productId: pkg.product.identifier };
51
51
  }
52
52
 
53
53
  // Purchase completed but no entitlement - still notify (test store scenario)
54
54
  await notifyPurchaseCompleted(deps.config, userId, pkg.product.identifier, customerInfo, source);
55
55
  clearSavedPurchase();
56
- return { success: true, isPremium: false, customerInfo };
56
+ return { success: true, isPremium: false, customerInfo, productId: pkg.product.identifier };
57
57
  } catch (error) {
58
58
  if (isUserCancelledError(error)) {
59
- return { success: false, isPremium: false };
59
+ return { success: false, isPremium: false, productId: pkg.product.identifier };
60
60
  }
61
61
  const errorMessage = getErrorMessage(error, "Purchase failed");
62
62
  throw new RevenueCatPurchaseError(errorMessage, pkg.product.identifier);
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { useCallback, useMemo } from "react";
9
- import { useCredits } from "../../../../presentation/hooks/useCredits";
9
+ import { useCredits } from "../../../credits/presentation/useCredits";
10
10
  import {
11
11
  useTransactionHistory,
12
12
  type UseTransactionHistoryParams,
@@ -13,6 +13,9 @@ export interface InitializeResult {
13
13
  export interface PurchaseResult {
14
14
  success: boolean;
15
15
  productId: string | null;
16
+ isPremium: boolean;
17
+ customerInfo?: CustomerInfo;
18
+ isConsumable?: boolean;
16
19
  }
17
20
 
18
21
  export interface RestoreResult {