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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user