diff --git a/apps/mobile/src/app/account/subscription.tsx b/apps/mobile/src/app/account/subscription.tsx index faddc35..1588a9a 100644 --- a/apps/mobile/src/app/account/subscription.tsx +++ b/apps/mobile/src/app/account/subscription.tsx @@ -144,6 +144,11 @@ export default function SubscriptionScreen() { {pkg.product.priceString} / {pkg.packageType === "ANNUAL" ? "yıl" : "ay"} + {pkg.product.introPrice ? ( + + 7 gün ücretsiz dene + + ) : null} {purchasingPackageId === pkg.identifier ? ( diff --git a/apps/mobile/src/app/menu/index.tsx b/apps/mobile/src/app/menu/index.tsx index 35437d1..e1a18b7 100644 --- a/apps/mobile/src/app/menu/index.tsx +++ b/apps/mobile/src/app/menu/index.tsx @@ -16,6 +16,7 @@ import * as Haptics from "expo-haptics"; import { api } from "@/lib/api"; import { getActiveRestaurant, type ActiveRestaurant } from "@/lib/active-restaurant"; import { getPublicMenuUrl, getPublicMenuDisplayUrl } from "@/lib/urls"; +import { getCustomerInfo, isProActive } from "@/lib/purchases"; import { CategoryPillBar } from "@/components/menu/CategoryPillBar"; import { MenuItemCard, type MenuItemData } from "@/components/menu/MenuItemCard"; import { ItemDetailSheet } from "@/components/menu/ItemDetailSheet"; @@ -250,6 +251,28 @@ export default function MenuEditorScreen() { // Publish async function onPublish() { if (!active) return; + + // Publishing (and re-publishing after a lapsed subscription — PRD §15) + // requires an active Pro entitlement or trial. RevenueCat's SDK starts + // the trial automatically on first purchase if the customer is eligible. + try { + const info = await getCustomerInfo(); + if (!isProActive(info)) { + Alert.alert( + "Menünüzü yayınlamak için abone olun", + "7 gün ücretsiz deneyin, istediğiniz zaman iptal edin.", + [ + { text: "Vazgeç", style: "cancel" }, + { text: "Devam Et", onPress: () => router.push("/account/subscription") }, + ], + ); + return; + } + } catch (err) { + Alert.alert("Hata", err instanceof Error ? err.message : "Abonelik durumu kontrol edilemedi."); + return; + } + setPublishing(true); try { await api.post(`/menus/${active.menuId}/publish`);