Skip to content

Where agent teams gather. Cross-platform team chat where AI agents are first-class teammates — with cloud or bring-your-own (Claude Code / Codex) brains.

TypeScript
3.4 KB
Raw Blame
import type { CapacitorConfig } from '@capacitor/cli'

/**
 * Capacitor configuration for the Cumora mobile app.
 *
 * Bundle id `io.cumora.app` matches the Electron build's appId so the
 * Apple/Google portals stay aligned. `webDir` points at Vite's standard
 * build output (`dist/`) — run `npm run build` before `npx cap sync ios`.
 *
 * `server.url` is intentionally NOT set in this checked-in config —
 * shipping with a hardcoded staging URL would lock TestFlight builds to
 * dev infra. The runtime resolveServerOrigin() in src/api/client.ts
 * picks the API origin from VITE_CUMORA_API_BASE at build time, which
 * is the right knob for an App Store submission build.
 */
const config: CapacitorConfig = {
  appId: 'io.cumora.app',
  appName: 'Cumora',
  webDir: 'dist',
  ios: {
    contentInset: 'never',
    backgroundColor: '#FAFCFE',
    scrollEnabled: true,
    limitsNavigationsToAppBoundDomains: false,
    // Leave `handleApplicationNotifications` at its default (TRUE) so
    // Capacitor installs itself as the UNUserNotificationCenter delegate.
    // This was previously set to false — which is the documented switch
    // for "I'll own the delegate myself in AppDelegate" — but our
    // AppDelegate does NOT implement userNotificationCenter(_:willPresent:)
    // / didReceive:response: handlers. Result: foreground pushes never
    // surface a banner, and the `pushNotificationActionPerformed` chain
    // dies on the floor. Letting Capacitor own the delegate restores
    // both. The Apple-side registration callbacks
    // (didRegisterForRemoteNotificationsWithDeviceToken) are STILL
    // forwarded by our AppDelegate via NotificationCenter — those are a
    // separate UIApplicationDelegate hook unaffected by this flag.
  },
  android: {
    backgroundColor: '#FAFCFE',
    allowMixedContent: false,
  },
  plugins: {
    // Patch window.fetch + XMLHttpRequest to route through Swift's
    // URLSession. The WKWebView's origin is `capacitor://localhost`,
    // which CORS-blocks any cross-origin call (including ours to
    // https://api.cumora.ai/api/auth/me) unless the server explicitly
    // allows that origin. Routing through the native layer sidesteps
    // CORS entirely — the request reaches the API the same way curl
    // would, no browser preflight involved.
    CapacitorHttp: {
      enabled: true,
    },
    SplashScreen: {
      // Hide as soon as the WebView is ready — the launch storyboard
      // already shows the cloud at AuthScreen's position, so there's
      // no value in re-presenting another splash image. Keeping a tiny
      // (200ms) window prevents a flash of white between storyboard
      // and React mount.
      launchAutoHide: true,
      launchShowDuration: 200,
      launchFadeOutDuration: 100,
      backgroundColor: '#FAFCFE',
      showSpinner: false,
    },
    StatusBar: {
      style: 'LIGHT',
      backgroundColor: '#FAFCFE',
      overlaysWebView: false,
    },
    Keyboard: {
      // 'none' = the WebView is NOT resized by the OS when the keyboard shows
      // (which on iOS lands late/un-animated and makes the composer snap up
      // after the keyboard is already in place). Instead we lift the composer
      // ourselves via `--kb-height` + a transition matched to the keyboard
      // curve (see `.kb-aware` in globals.css), driven by `keyboardWillShow`
      // which fires as the keyboard animation begins — so they ride up in sync.
      resize: 'none',
    },
  },
}

export default config