fix(mobile): stop matching entitlement by hardcoded identifier string

RevenueCat's entitlement identifier contains U+2024 (ONE DOT LEADER),
not a plain period — "Menul.io Pro" never matched the real
"Menul⁚io Pro" key, so isProActive() stayed false even after a real
purchase (confirmed via a genuine sandbox trial that RevenueCat
recorded as active while the app kept showing "Ücretsiz plan").
RevenueCat's API doesn't allow renaming an entitlement's lookup_key
after creation (405), so fixed on our side instead: this app only
ever grants one entitlement, so "any active entitlement" == Pro,
no identifier string needed.
This commit is contained in:
AyrisAI
2026-08-20 16:15:44 +03:00
parent 102cc0781e
commit bb4cd1b0fc
2 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import { Ionicons } from "@expo/vector-icons";
import type { CustomerInfo, PurchasesOffering, PurchasesPackage } from "react-native-purchases";
import Purchases from "react-native-purchases";
import { getActiveRestaurant } from "@/lib/active-restaurant";
import { configurePurchases, getCurrentOffering, getCustomerInfo, isProActive, PRO_ENTITLEMENT_ID } from "@/lib/purchases";
import { configurePurchases, getActiveEntitlement, getCurrentOffering, getCustomerInfo, isProActive } from "@/lib/purchases";
export default function SubscriptionScreen() {
const insets = useSafeAreaInsets();
@@ -74,7 +74,7 @@ export default function SubscriptionScreen() {
}
const isPro = customerInfo ? isProActive(customerInfo) : false;
const expiresAt = customerInfo?.entitlements.active[PRO_ENTITLEMENT_ID]?.expirationDate;
const expiresAt = customerInfo ? getActiveEntitlement(customerInfo)?.expirationDate : null;
if (loading) {
return (