@umituz/react-native-subscription 2.14.78 → 2.14.80
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.80",
|
|
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",
|
|
@@ -83,6 +83,18 @@ export async function handlePurchase(
|
|
|
83
83
|
return { success: true, isPremium: true, customerInfo };
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
// In Preview API mode (Expo Go), purchases complete but entitlements aren't active
|
|
87
|
+
// Treat the purchase as successful for testing purposes
|
|
88
|
+
if (deps.isUsingTestStore()) {
|
|
89
|
+
await notifyPurchaseCompleted(
|
|
90
|
+
deps.config,
|
|
91
|
+
userId,
|
|
92
|
+
pkg.product.identifier,
|
|
93
|
+
customerInfo
|
|
94
|
+
);
|
|
95
|
+
return { success: true, isPremium: false, customerInfo };
|
|
96
|
+
}
|
|
97
|
+
|
|
86
98
|
throw new RevenueCatPurchaseError(
|
|
87
99
|
"Purchase completed but premium entitlement not active",
|
|
88
100
|
pkg.product.identifier
|
|
@@ -11,6 +11,7 @@ export type SubscriptionPackageType = "weekly" | "monthly" | "yearly" | "unknown
|
|
|
11
11
|
* - premium_weekly, weekly_premium, premium-weekly
|
|
12
12
|
* - premium_monthly, monthly_premium, premium-monthly
|
|
13
13
|
* - premium_yearly, yearly_premium, premium-yearly, premium_annual, annual_premium
|
|
14
|
+
* - preview-product-id (Preview API mode in Expo Go)
|
|
14
15
|
*/
|
|
15
16
|
export function detectPackageType(productIdentifier: string): SubscriptionPackageType {
|
|
16
17
|
if (!productIdentifier) {
|
|
@@ -26,6 +27,14 @@ export function detectPackageType(productIdentifier: string): SubscriptionPackag
|
|
|
26
27
|
console.log("[PackageTypeDetector] Detecting package type for:", normalized);
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
// Preview API mode (Expo Go testing)
|
|
31
|
+
if (normalized.includes("preview")) {
|
|
32
|
+
if (__DEV__) {
|
|
33
|
+
console.log("[PackageTypeDetector] Detected: PREVIEW (monthly)");
|
|
34
|
+
}
|
|
35
|
+
return "monthly";
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
// Weekly detection
|
|
30
39
|
if (normalized.includes("weekly") || normalized.includes("week")) {
|
|
31
40
|
if (__DEV__) {
|