@umituz/react-native-subscription 2.14.71 → 2.14.73
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.
|
|
3
|
+
"version": "2.14.73",
|
|
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",
|
|
@@ -112,6 +112,7 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = ({
|
|
|
112
112
|
if (isAnonymous) {
|
|
113
113
|
if (__DEV__) {
|
|
114
114
|
console.log("[PaywallContainer] Anonymous user, storing package and requiring auth:", pkg.identifier);
|
|
115
|
+
console.log("[PaywallContainer] onAuthRequired is defined:", !!onAuthRequired);
|
|
115
116
|
}
|
|
116
117
|
// Store package for auto-purchase after auth
|
|
117
118
|
setPendingPackage(pkg);
|
|
@@ -65,11 +65,23 @@ export const useSubscriptionSettingsConfig = (
|
|
|
65
65
|
// This is the source of truth, subscriptionActive is just a backup
|
|
66
66
|
const isPremium = !!premiumEntitlement || subscriptionActive;
|
|
67
67
|
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
const
|
|
68
|
+
// Get expiration date from RevenueCat entitlement (source of truth)
|
|
69
|
+
// premiumEntitlement.expirationDate is an ISO string from RevenueCat
|
|
70
|
+
const entitlementExpirationDate = premiumEntitlement?.expirationDate || null;
|
|
71
|
+
|
|
72
|
+
// Prefer CustomerInfo expiration (real-time) over cached status
|
|
73
|
+
const expiresAtIso = entitlementExpirationDate || (statusExpirationDate
|
|
71
74
|
? statusExpirationDate.toISOString()
|
|
72
|
-
:
|
|
75
|
+
: null);
|
|
76
|
+
|
|
77
|
+
if (__DEV__) {
|
|
78
|
+
console.log("[useSubscriptionSettingsConfig] Date sources:", {
|
|
79
|
+
entitlementExpirationDate,
|
|
80
|
+
statusExpirationDate: statusExpirationDate?.toISOString() || null,
|
|
81
|
+
finalExpiresAtIso: expiresAtIso,
|
|
82
|
+
premiumEntitlementKeys: premiumEntitlement ? Object.keys(premiumEntitlement) : null,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
73
85
|
|
|
74
86
|
const willRenew = premiumEntitlement?.willRenew || false;
|
|
75
87
|
const purchasedAtIso = convertPurchasedAt(credits?.purchasedAt);
|