@umituz/react-native-subscription 2.12.17 → 2.12.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 +14 -7
- package/src/application/ports/ISubscriptionRepository.ts +1 -1
- package/src/application/ports/ISubscriptionService.ts +1 -1
- package/src/domain/value-objects/SubscriptionConfig.ts +1 -1
- package/src/domains/paywall/components/CreditCard.tsx +5 -2
- package/src/domains/paywall/components/FeatureList.tsx +1 -1
- package/src/domains/paywall/components/PaywallModal.tsx +7 -3
- package/src/domains/paywall/components/PaywallTabBar.tsx +1 -1
- package/src/domains/paywall/components/PlanCard.tsx +3 -1
- package/src/domains/paywall/entities/types.ts +1 -0
- package/src/index.ts +54 -54
- package/src/infrastructure/repositories/CreditsRepository.ts +3 -3
- package/src/infrastructure/repositories/CreditsRepositoryProvider.ts +2 -2
- package/src/infrastructure/services/ActivationHandler.ts +3 -3
- package/src/infrastructure/services/CreditsInitializer.ts +1 -1
- package/src/infrastructure/services/SubscriptionService.ts +6 -6
- package/src/presentation/components/details/PremiumDetailsCard.tsx +19 -48
- package/src/presentation/components/details/PremiumDetailsCardTypes.ts +5 -3
- package/src/presentation/components/details/PremiumStatusBadge.tsx +9 -9
- package/src/presentation/hooks/useCreditChecker.ts +3 -3
- package/src/presentation/hooks/useCredits.ts +2 -2
- package/src/presentation/hooks/useDeductCredit.ts +2 -2
- package/src/presentation/hooks/useDevTestCallbacks.ts +2 -2
- package/src/presentation/hooks/usePremiumWithConfig.ts +2 -2
- package/src/presentation/hooks/useSubscription.ts +3 -3
- package/src/presentation/hooks/useSubscriptionDetails.ts +2 -2
- package/src/presentation/hooks/useUserTier.ts +2 -2
- package/src/presentation/hooks/useUserTierWithRepository.ts +1 -1
- package/src/presentation/screens/SubscriptionDetailScreen.tsx +12 -11
- package/src/presentation/screens/components/CreditItem.tsx +8 -11
- package/src/presentation/screens/components/SubscriptionActions.tsx +10 -22
- package/src/presentation/screens/components/SubscriptionHeader.tsx +22 -22
- 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
|
@@ -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 "@revenuecat/application/ports/IRevenueCatService";
|
|
8
8
|
import {
|
|
9
9
|
RevenueCatPurchaseError,
|
|
10
10
|
RevenueCatInitializationError,
|
|
11
|
-
} from "
|
|
12
|
-
import type { RevenueCatConfig } from "
|
|
11
|
+
} from "@revenuecat/domain/errors/RevenueCatError";
|
|
12
|
+
import type { RevenueCatConfig } from "@revenuecat/domain/value-objects/RevenueCatConfig";
|
|
13
13
|
import {
|
|
14
14
|
isUserCancelledError,
|
|
15
15
|
getErrorMessage,
|
|
16
|
-
} from "
|
|
16
|
+
} from "@revenuecat/domain/types/RevenueCatTypes";
|
|
17
17
|
import {
|
|
18
18
|
syncPremiumStatus,
|
|
19
19
|
notifyPurchaseCompleted,
|
|
20
|
-
} from "
|
|
20
|
+
} from "@revenuecat/infrastructure/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 "@revenuecat/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 "@revenuecat/domain/errors/RevenueCatError";
|
|
12
|
+
import type { RevenueCatConfig } from "@revenuecat/domain/value-objects/RevenueCatConfig";
|
|
13
|
+
import { getErrorMessage } from "@revenuecat/domain/types/RevenueCatTypes";
|
|
14
14
|
import {
|
|
15
15
|
syncPremiumStatus,
|
|
16
16
|
notifyRestoreCompleted,
|
|
17
|
-
} from "
|
|
17
|
+
} from "@revenuecat/infrastructure/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 "@revenuecat/application/ports/IRevenueCatService";
|
|
8
|
+
import type { RevenueCatConfig } from "@revenuecat/domain/value-objects/RevenueCatConfig";
|
|
9
|
+
import { getErrorMessage } from "@revenuecat/domain/types/RevenueCatTypes";
|
|
10
|
+
import { resolveApiKey } from "@revenuecat/infrastructure/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 "@revenuecat/application/ports/IRevenueCatService";
|
|
14
|
+
import type { RevenueCatConfig } from "@revenuecat/domain/value-objects/RevenueCatConfig";
|
|
15
|
+
import { resolveApiKey } from "@revenuecat/infrastructure/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 "@revenuecat/domain/value-objects/RevenueCatConfig";
|
|
7
|
+
import { isExpoGo, isDevelopment } from "@revenuecat/infrastructure/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 "@revenuecat/domain/value-objects/RevenueCatConfig";
|
|
8
8
|
import { isExpoGo, isProductionBuild } 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 "@revenuecat/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 "@revenuecat/domain/value-objects/RevenueCatConfig";
|
|
8
|
+
import { getPremiumEntitlement } from "@revenuecat/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 "@revenuecat/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 "@revenuecat/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 "@revenuecat/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 "@revenuecat/infrastructure/services/RevenueCatService";
|
|
9
|
+
import type { PurchaseResult, RestoreResult } from "@revenuecat/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 "@revenuecat/infrastructure/managers/SubscriptionManager";
|
|
8
8
|
import { addPackageBreadcrumb } from "@umituz/react-native-sentry";
|
|
9
9
|
import {
|
|
10
10
|
SUBSCRIPTION_QUERY_KEYS,
|