@umituz/react-native-subscription 2.12.27 → 2.12.29
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 +1 -1
- package/src/domains/paywall/components/CreditCard.tsx +2 -2
- package/src/domains/paywall/components/FeatureList.tsx +1 -1
- package/src/domains/paywall/components/PaywallModal.tsx +1 -1
- package/src/domains/paywall/components/PaywallTabBar.tsx +1 -1
- package/src/domains/paywall/components/PlanCard.tsx +1 -1
- package/src/presentation/components/details/PremiumStatusBadge.tsx +1 -1
- package/src/revenuecat/infrastructure/handlers/PackageHandler.ts +2 -2
- package/src/revenuecat/infrastructure/managers/SubscriptionManager.ts +7 -7
- package/src/revenuecat/infrastructure/services/CustomerInfoListenerManager.ts +2 -2
- package/src/revenuecat/infrastructure/services/PurchaseHandler.ts +5 -5
- package/src/revenuecat/infrastructure/services/RestoreHandler.ts +5 -5
- package/src/revenuecat/infrastructure/services/RevenueCatInitializer.ts +4 -4
- package/src/revenuecat/infrastructure/services/RevenueCatService.ts +3 -3
- package/src/revenuecat/infrastructure/services/ServiceStateManager.ts +2 -2
- package/src/revenuecat/infrastructure/utils/ApiKeyResolver.ts +1 -1
- package/src/revenuecat/infrastructure/utils/ExpirationDateCalculator.ts +1 -1
- package/src/revenuecat/infrastructure/utils/PremiumStatusSyncer.ts +2 -2
- package/src/revenuecat/presentation/hooks/useInitializeSubscription.ts +1 -1
- package/src/revenuecat/presentation/hooks/usePurchasePackage.ts +1 -1
- package/src/revenuecat/presentation/hooks/useRestorePurchase.ts +1 -1
- package/src/revenuecat/presentation/hooks/useRevenueCat.ts +2 -2
- package/src/revenuecat/presentation/hooks/useSubscriptionPackages.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.29",
|
|
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",
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
8
|
import { AtomicText, AtomicIcon, AtomicBadge, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
|
-
import type { CreditsPackage } from
|
|
9
|
+
import type { CreditsPackage } from '../entities";
|
|
10
10
|
|
|
11
|
-
import { formatPrice } from
|
|
11
|
+
import { formatPrice } from '../../../utils/priceUtils";
|
|
12
12
|
|
|
13
13
|
interface CreditCardProps {
|
|
14
14
|
pkg: CreditsPackage;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { View, StyleSheet } from "react-native";
|
|
8
8
|
import { FeatureItem } from "./FeatureItem";
|
|
9
|
-
import type { SubscriptionFeature } from
|
|
9
|
+
import type { SubscriptionFeature } from '../entities";
|
|
10
10
|
|
|
11
11
|
interface FeatureListProps {
|
|
12
12
|
features: SubscriptionFeature[];
|
|
@@ -9,7 +9,7 @@ import { BaseModal, useAppDesignTokens, AtomicText, AtomicIcon } from "@umituz/r
|
|
|
9
9
|
import type { PurchasesPackage } from "react-native-purchases";
|
|
10
10
|
import { PlanCard } from "./PlanCard";
|
|
11
11
|
import { CreditCard } from "./CreditCard";
|
|
12
|
-
import type { PaywallMode, CreditsPackage, SubscriptionFeature, PaywallTranslations, PaywallLegalUrls } from
|
|
12
|
+
import type { PaywallMode, CreditsPackage, SubscriptionFeature, PaywallTranslations, PaywallLegalUrls } from '../entities";
|
|
13
13
|
|
|
14
14
|
export interface PaywallModalProps {
|
|
15
15
|
visible: boolean;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { View, TouchableOpacity, StyleSheet, Animated } from "react-native";
|
|
8
8
|
import { AtomicText, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
|
-
import type { PaywallTabType } from
|
|
9
|
+
import type { PaywallTabType } from '../entities";
|
|
10
10
|
|
|
11
11
|
interface PaywallTabBarProps {
|
|
12
12
|
activeTab: PaywallTabType;
|
|
@@ -8,7 +8,7 @@ import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
|
8
8
|
import { AtomicText, AtomicIcon, AtomicBadge, useAppDesignTokens } from "@umituz/react-native-design-system";
|
|
9
9
|
import type { PurchasesPackage } from "react-native-purchases";
|
|
10
10
|
|
|
11
|
-
import { formatPrice } from
|
|
11
|
+
import { formatPrice } from '../../../utils/priceUtils";
|
|
12
12
|
|
|
13
13
|
interface PlanCardProps {
|
|
14
14
|
pkg: PurchasesPackage;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { View, StyleSheet } from "react-native";
|
|
8
8
|
import { useAppDesignTokens, AtomicText } from "@umituz/react-native-design-system";
|
|
9
|
-
import { SubscriptionStatusType } from
|
|
9
|
+
import { SubscriptionStatusType } from '../../../domain/entities/SubscriptionStatus";
|
|
10
10
|
export type { SubscriptionStatusType };
|
|
11
11
|
|
|
12
12
|
export interface PremiumStatusBadgeProps {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { PurchasesPackage } from "react-native-purchases";
|
|
7
|
-
import type { IRevenueCatService } from
|
|
8
|
-
import { getPremiumEntitlement } from
|
|
7
|
+
import type { IRevenueCatService } from '../../application/ports/IRevenueCatService";
|
|
8
|
+
import { getPremiumEntitlement } from '../../domain/types/RevenueCatTypes";
|
|
9
9
|
import {
|
|
10
10
|
trackPackageError,
|
|
11
11
|
addPackageBreadcrumb,
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { PurchasesPackage } from "react-native-purchases";
|
|
8
|
-
import type { RevenueCatConfig } from
|
|
9
|
-
import type { IRevenueCatService } from
|
|
10
|
-
import { initializeRevenueCatService, getRevenueCatService } from
|
|
11
|
-
import { UserIdProvider } from
|
|
12
|
-
import { InitializationCache } from
|
|
13
|
-
import { PackageHandler } from
|
|
14
|
-
import type { PremiumStatus } from
|
|
8
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
9
|
+
import type { IRevenueCatService } from '../../application/ports/IRevenueCatService";
|
|
10
|
+
import { initializeRevenueCatService, getRevenueCatService } from '../services/RevenueCatService";
|
|
11
|
+
import { UserIdProvider } from '../utils/UserIdProvider";
|
|
12
|
+
import { InitializationCache } from '../utils/InitializationCache";
|
|
13
|
+
import { PackageHandler } from '../handlers/PackageHandler";
|
|
14
|
+
import type { PremiumStatus } from '../handlers/PackageHandler";
|
|
15
15
|
import {
|
|
16
16
|
trackPackageError,
|
|
17
17
|
addPackageBreadcrumb,
|
|
@@ -7,8 +7,8 @@ import Purchases, {
|
|
|
7
7
|
type CustomerInfo,
|
|
8
8
|
type CustomerInfoUpdateListener,
|
|
9
9
|
} from "react-native-purchases";
|
|
10
|
-
import type { RevenueCatConfig } from
|
|
11
|
-
import { syncPremiumStatus } from
|
|
10
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
11
|
+
import { syncPremiumStatus } from '../utils/PremiumStatusSyncer";
|
|
12
12
|
import { addPackageBreadcrumb } from "@umituz/react-native-sentry";
|
|
13
13
|
|
|
14
14
|
export class CustomerInfoListenerManager {
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import Purchases, { type PurchasesPackage } from "react-native-purchases";
|
|
7
|
-
import type { PurchaseResult } from
|
|
7
|
+
import type { PurchaseResult } from '../../application/ports/IRevenueCatService";
|
|
8
8
|
import {
|
|
9
9
|
RevenueCatPurchaseError,
|
|
10
10
|
RevenueCatInitializationError,
|
|
11
|
-
} from
|
|
12
|
-
import type { RevenueCatConfig } from
|
|
11
|
+
} from '../../domain/errors/RevenueCatError";
|
|
12
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
13
13
|
import {
|
|
14
14
|
isUserCancelledError,
|
|
15
15
|
getErrorMessage,
|
|
16
|
-
} from
|
|
16
|
+
} from '../../domain/types/RevenueCatTypes";
|
|
17
17
|
import {
|
|
18
18
|
syncPremiumStatus,
|
|
19
19
|
notifyPurchaseCompleted,
|
|
20
|
-
} from
|
|
20
|
+
} from '../utils/PremiumStatusSyncer";
|
|
21
21
|
import {
|
|
22
22
|
trackPackageError,
|
|
23
23
|
addPackageBreadcrumb,
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import Purchases from "react-native-purchases";
|
|
7
|
-
import type { RestoreResult } from
|
|
7
|
+
import type { RestoreResult } from '../../application/ports/IRevenueCatService";
|
|
8
8
|
import {
|
|
9
9
|
RevenueCatRestoreError,
|
|
10
10
|
RevenueCatInitializationError,
|
|
11
|
-
} from
|
|
12
|
-
import type { RevenueCatConfig } from
|
|
13
|
-
import { getErrorMessage } from
|
|
11
|
+
} from '../../domain/errors/RevenueCatError";
|
|
12
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
13
|
+
import { getErrorMessage } from '../../domain/types/RevenueCatTypes";
|
|
14
14
|
import {
|
|
15
15
|
syncPremiumStatus,
|
|
16
16
|
notifyRestoreCompleted,
|
|
17
|
-
} from
|
|
17
|
+
} from '../utils/PremiumStatusSyncer";
|
|
18
18
|
import {
|
|
19
19
|
trackPackageError,
|
|
20
20
|
addPackageBreadcrumb,
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import Purchases from "react-native-purchases";
|
|
7
|
-
import type { InitializeResult } from
|
|
8
|
-
import type { RevenueCatConfig } from
|
|
9
|
-
import { getErrorMessage } from
|
|
10
|
-
import { resolveApiKey } from
|
|
7
|
+
import type { InitializeResult } from '../../application/ports/IRevenueCatService";
|
|
8
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
9
|
+
import { getErrorMessage } from '../../domain/types/RevenueCatTypes";
|
|
10
|
+
import { resolveApiKey } from '../utils/ApiKeyResolver";
|
|
11
11
|
import {
|
|
12
12
|
trackPackageError,
|
|
13
13
|
addPackageBreadcrumb,
|
|
@@ -10,9 +10,9 @@ import type {
|
|
|
10
10
|
InitializeResult,
|
|
11
11
|
PurchaseResult,
|
|
12
12
|
RestoreResult,
|
|
13
|
-
} from
|
|
14
|
-
import type { RevenueCatConfig } from
|
|
15
|
-
import { resolveApiKey } from
|
|
13
|
+
} from '../../application/ports/IRevenueCatService";
|
|
14
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
15
|
+
import { resolveApiKey } from '../utils/ApiKeyResolver";
|
|
16
16
|
import { initializeSDK } from "./RevenueCatInitializer";
|
|
17
17
|
import { fetchOfferings } from "./OfferingsFetcher";
|
|
18
18
|
import { handlePurchase } from "./PurchaseHandler";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Manages RevenueCat service state
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { RevenueCatConfig } from
|
|
7
|
-
import { isExpoGo, isDevelopment } from
|
|
6
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
7
|
+
import { isExpoGo, isDevelopment } from '../utils/ExpoGoDetector";
|
|
8
8
|
|
|
9
9
|
export class ServiceStateManager {
|
|
10
10
|
private isInitializedFlag: boolean = false;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* NOTE: Main app is responsible for resolving platform-specific keys
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { RevenueCatConfig } from
|
|
7
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
8
8
|
import { isTestStoreEnvironment } from "./ExpoGoDetector";
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Handles RevenueCat expiration date extraction
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { RevenueCatEntitlement } from
|
|
6
|
+
import type { RevenueCatEntitlement } from '../../domain/types/RevenueCatTypes";
|
|
7
7
|
|
|
8
8
|
export function getExpirationDate(
|
|
9
9
|
entitlement: RevenueCatEntitlement | null
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { CustomerInfo } from "react-native-purchases";
|
|
7
|
-
import type { RevenueCatConfig } from
|
|
8
|
-
import { getPremiumEntitlement } from
|
|
7
|
+
import type { RevenueCatConfig } from '../../domain/value-objects/RevenueCatConfig";
|
|
8
|
+
import { getPremiumEntitlement } from '../../domain/types/RevenueCatTypes";
|
|
9
9
|
import { getExpirationDate } from "./ExpirationDateCalculator";
|
|
10
10
|
import {
|
|
11
11
|
trackPackageError,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
7
|
-
import { SubscriptionManager } from
|
|
7
|
+
import { SubscriptionManager } from '../../infrastructure/managers/SubscriptionManager";
|
|
8
8
|
import {
|
|
9
9
|
trackPackageError,
|
|
10
10
|
addPackageBreadcrumb,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
7
7
|
import type { PurchasesPackage } from "react-native-purchases";
|
|
8
|
-
import { SubscriptionManager } from
|
|
8
|
+
import { SubscriptionManager } from '../../infrastructure/managers/SubscriptionManager";
|
|
9
9
|
import {
|
|
10
10
|
trackPackageError,
|
|
11
11
|
addPackageBreadcrumb,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
7
|
-
import { SubscriptionManager } from
|
|
7
|
+
import { SubscriptionManager } from '../../infrastructure/managers/SubscriptionManager";
|
|
8
8
|
import {
|
|
9
9
|
trackPackageError,
|
|
10
10
|
addPackageBreadcrumb,
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { useState, useCallback } from "react";
|
|
7
7
|
import type { PurchasesOffering, PurchasesPackage } from "react-native-purchases";
|
|
8
|
-
import { getRevenueCatService } from
|
|
9
|
-
import type { PurchaseResult, RestoreResult } from
|
|
8
|
+
import { getRevenueCatService } from '../../infrastructure/services/RevenueCatService";
|
|
9
|
+
import type { PurchaseResult, RestoreResult } from '../../application/ports/IRevenueCatService";
|
|
10
10
|
|
|
11
11
|
export interface UseRevenueCatResult {
|
|
12
12
|
/** Current offering */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useQuery } from "@tanstack/react-query";
|
|
7
|
-
import { SubscriptionManager } from
|
|
7
|
+
import { SubscriptionManager } from '../../infrastructure/managers/SubscriptionManager";
|
|
8
8
|
import { addPackageBreadcrumb } from "@umituz/react-native-sentry";
|
|
9
9
|
import {
|
|
10
10
|
SUBSCRIPTION_QUERY_KEYS,
|