File size: 2,070 Bytes
9580dce | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 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;
|