Skip to content

fix: configure native voice api origin#364

Merged
rogerchappel merged 1 commit into
mainfrom
fix/native-background-voice-diagnostics
May 11, 2026
Merged

fix: configure native voice api origin#364
rogerchappel merged 1 commit into
mainfrom
fix/native-background-voice-diagnostics

Conversation

@rogerchappel
Copy link
Copy Markdown
Owner

Summary

  • Fix native iOS background voice uploads so the plugin uses a real HTTP(S) CrewCmd API origin instead of Capacitor's local capacitor:// origin.
  • Add NEXT_PUBLIC_CREWCMD_NATIVE_API_BASE_URL as the explicit mobile-native API origin, falling back to NEXT_PUBLIC_APP_URL.
  • Add native diagnostics for native.config.base-url, unsupported base URLs, and not-configured native upload/chat paths.

Why

After testing PR #361 on device, iOS kept the microphone indicator live in background/lock, but spoken turns never reached the agent. The likely cause is that native URLSession was handed window.location.origin; in a bundled Capacitor app that can be capacitor://localhost, which native networking cannot POST to. Foreground WebView fetches can still work, making this fail only in the native/background path.

Verification

  • node --check apps/mobile/scripts/ensure-ios-voice-session.mjs
  • pnpm lint:check -- apps/mobile/scripts/ensure-ios-voice-session.mjs src/lib/native-voice-session.ts (passes; existing repo warnings only)
  • git diff --check
  • pnpm typecheck
  • cd apps/mobile && pnpm ios:voice-session && pnpm check

Test notes for device rebuild

Set NEXT_PUBLIC_CREWCMD_NATIVE_API_BASE_URL to the CrewCmd server URL reachable from the phone before rebuilding/syncing the Capacitor app. If unset, the native path falls back to NEXT_PUBLIC_APP_URL.

@rogerchappel rogerchappel merged commit a030743 into main May 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant