Skip to Content
🚀 Orga AI is in open beta.
How-to GuidesTroubleshootingFix React Native SDK issues

Fix React Native SDK issues

React Native introduces extra moving parts—native modules, permissions, and physical devices. Use the sections below to match a symptom to the fix.

SDK not initialized

Error

OrgaAI must be initialized before use. Call OrgaAI.init() first.

Fix

app/_layout.tsx
import { OrgaAI, OrgaAIProvider } from '@orga-ai/react-native'; OrgaAI.init({ fetchSessionConfig: async () => { const res = await fetch('https://api.yourdomain.com/orga-client-secrets'); return res.json(); }, model: 'orga-1-beta', voice: 'alloy', }); export default function RootLayout() { return ( <OrgaAIProvider> <Stack /> </OrgaAIProvider> ); }

Hook used outside provider

Error

useOrgaAI must be used within an OrgaAIProvider

Fix – Wrap your navigator (Stack, Tabs, etc.) inside <OrgaAIProvider> in app/_layout.tsx.

Missing native dependencies

Error

Cannot find module 'react-native-webrtc' or 'react-native-incall-manager'

Fix

npm install @orga-ai/react-native react-native-webrtc react-native-incall-manager npx expo prebuild eas build --profile development

For bare RN, run npx pod-install after yarn/npm install.

Camera or microphone unavailable

CauseFix
Permissions missingAdd camera/mic strings to app.json (NSCameraUsageDescription, NSMicrophoneUsageDescription, Android android.permission.CAMERA, android.permission.RECORD_AUDIO). Rebuild the dev client.
Using Expo GoBuild an Expo development client. Expo Go lacks the required native modules.
Simulator limitationsTest on a physical device for real camera/mic access.
User denied accessPrompt again or direct users to system settings to re-enable.

Connection fails after startSession()

  1. Verify your backend proxy returns both fields:
curl https://api.yourdomain.com/orga-client-secrets
{ "ephemeralToken": "...", "iceServers": [...] }
  1. Confirm your proxy calls both /v1/realtime/client-secrets and /v1/realtime/ice-config.
  2. Update to the latest server SDK and ensure your API key is valid.

“Device not supported” during build

  • Minimum React Native version: 0.72+
  • Minimum Expo SDK: 50+
  • Build with:
npx expo prebuild eas build --profile development

No audio playback

  • Ensure react-native-incall-manager is installed and linked.
  • Force speaker output when needed:
import InCallManager from 'react-native-incall-manager'; InCallManager.setSpeakerphoneOn(true);
  • Test with wired/Bluetooth audio; some Android devices default to earpiece mode.

Missing environment variables

If your proxy returns 401/500, verify the server has:

ORGA_API_KEY=sk_orga_ai_******************************

Run with logLevel: 'debug' in OrgaAI.init() and watch expo start --dev-client logs for ICE negotiation steps.

Last updated on