feat(mobile): integrate react-native-purchases (RevenueCat)

- Purchases.configure() runs with appUserID = restaurantId at every
  point the id becomes known (login resolve, cold-start rehydration,
  onboarding restaurant creation) — this must match what the backend
  webhook expects (see apps/api/src/routes/subscription.ts).
- New account/subscription.tsx paywall: current entitlement status,
  offering packages with real store prices, purchase, restore.
- Linked from the account screen.

Native module — requires an EAS/dev-client build, not plain Expo Go.
This commit is contained in:
AyrisAI
2026-08-20 13:20:54 +03:00
parent 3509388c37
commit b25c742eea
7 changed files with 249 additions and 0 deletions
@@ -4,6 +4,7 @@ import { ActivityIndicator, Pressable, ScrollView, Text, TextInput, View } from
import { Ionicons } from "@expo/vector-icons";
import { api } from "@/lib/api";
import { setActiveRestaurant } from "@/lib/active-restaurant";
import { configurePurchases } from "@/lib/purchases";
interface CreateRestaurantResponse {
restaurant: { id: string; slug: string };
@@ -34,6 +35,7 @@ export default function OnboardingRestaurantStep() {
menuId: menu.id,
slug: restaurant.slug,
});
configurePurchases(restaurant.id);
router.replace("/(onboarding)/scan");
} catch (err) {