import type { CapacitorConfig } from "@capacitor/cli"; /** * RotNot — Capacitor Configuration * * Strategy: "Live Reload from Remote Server" * The Next.js app (with App Router, SQLite, and AI API routes) cannot be * exported as a fully-static bundle. Instead, the Capacitor WebView loads * the production URL. Native plugins (haptics, notifications, etc.) are * available alongside the web UI. * * For local development, set CAPACITOR_SERVER_URL in your environment or * temporarily swap `url` below to your LAN address, e.g.: * url: "http://192.168.1.X:3101" * * For production, point to your deployed domain (Vercel / Railway / etc.). */ const config: CapacitorConfig = { appId: "com.rotnot.app", appName: "RotNot", webDir: "out", // Used only if static export is ever enabled server: { // Point to your production deployment. // For local dev, override with process.env.CAPACITOR_SERVER_URL. url: process.env.CAPACITOR_SERVER_URL ?? "https://rotnot.app", cleartext: false, // HTTPS only in production }, plugins: { // SplashScreen — hide immediately (app loads the web shell) SplashScreen: { launchShowDuration: 0, }, // PushNotifications — for streak reminders and spaced-repetition nudges PushNotifications: { presentationOptions: ["badge", "sound", "alert"], }, // LocalNotifications — offline fallback for exercise reminders LocalNotifications: { smallIcon: "ic_stat_icon_config_sample", iconColor: "#6366f1", // Indigo — matches RotNot brand }, // Haptics are configured per-call in code; no global config needed }, ios: { // Allows service worker / cache-control headers in WKWebView allowsLinkPreview: false, scrollEnabled: true, // limitsNavigationsToAppBoundDomains prevents external link leakage limitsNavigationsToAppBoundDomains: true, }, android: { // Ensure hardware back button navigates within the app, not exits allowMixedContent: false, captureInput: true, }, }; export default config;