RealTimeX
Sign inStart for free
RealTimeXMobile Package
Introduction5-minute overviewFeaturesHow the package worksGlossary
Requirements & dependenciesBackend credentialsInstallation step by stepTutorial — your first chat appProject config fileApp entry — index.jsQuick start — minimum working chatComplete ChatScreen example
Native configuration (iOS & Android)Firebase, APNs & backend setup
Navigation — embedding the chatSession, auth & Socket.IOPermissions & access controlAudio & video callingPush notificationsMentions viewRich-text messages (WebView editor)Total unread count
Customization — four waysDefault component fallback (important)Which slots are wiredCustomization examples (Case 1–4)UI feature flags & copy (ui)Chat info (group + DM)Style overrides (ui.styles)Render props (ChatProvider)Theme, fonts & appearance
ChatProvider props referenceconfigureChat options referenceHooks & storeCallbacks referenceAPI query paramsAll exports
Production integration pattern (Fieldr)Host app integration — providers, toasts, tab bars & navigationEnvironment variablesLocal package / monorepo (Metro)
TroubleshootingSetup checklistArchitectureDocumentation & file mapPackage development (maintainers)License
Mobile packageFeatures & Guides

Navigation — embedding the chat

ChatNavigator (recommended)

ChatNavigator registers every chat screen and mounts CallProvider (incoming-call overlay, call signaling). List taps open the room, info, etc. without host route wiring.

PropDefaultPurpose
initialRouteNameConversationListScreenFirst chat screen
withContainertrueWrap in its own NavigationContainer (inside NavigationIndependentTree)
navigationRef—Ref to the internal container (only with withContainer)
onReady—Internal container ready (only with withContainer)

Screens in the chat stack (AppScreen.*):

ScreenParamsPurpose
ConversationListScreen—List, search, FAB, header bell and @ button
ChatRoomScreenChatRoomParamsMessages, composer, threads, room menu
SelectUserScreen—New 1:1 chat
SelectGroupMembersScreenSelectGroupMembersParams (mode: 'create' | 'add', excludeUserIds)Pick group members
CreateGroupScreenCreateGroupParamsName, photo, permissions
ChatInfoScreenChatInfoParamsGroup / contact info
CanvasListScreen, CanvasEditorScreenCanvasListParams, CanvasEditorParamsCanvas documents
GlobalMessageSearchScreen—Search across conversations
ActiveCallScreen—Outgoing / in-call UI
CallsHistoryScreenCallsHistoryParamsCall history
CallRecordingsScreen{conversationId}Recordings of a conversation (route only — not a root export)
NotificationSettingsScreen—Push preferences
MentionsScreen—Mentions view

ChatRoomParams: conversationId, receiverUser, isGroup, groupName, peerDisplayName, openSearch, initialSearchQuery, focusMessageId, threadRootId.

Nested inside your own navigator

tsxsrc/navigation/BottomTabs.tsx
1// src/navigation/BottomTabs.tsx2<Tab.Screen name="Chat">3  {() => (4    <ChatProvider config={chatConfig}>5      <ChatNavigator withContainer={false} />6    </ChatProvider>7  )}8</Tab.Screen>

With withContainer={false} the chat stack registers itself with the call and push routers, so incoming-call accept and notification taps still open the right screen.

App-wide chat session (calls / push from any screen)

If the chat tab mounts lazily but you want the socket (presence, incoming calls) alive from app start, mount a ChatProvider + CallProvider near the root, pass your container ref, and register ActiveCallScreen in that root stack. Fieldr's version is ChatSessionHost.tsx. Minimal form:

tsxsrc/navigation/RootNavigator.tsx
1// src/navigation/RootNavigator.tsx2import {ActiveCallScreen, CallProvider, ChatProvider} from '@realtimexsco/live-chat-react-native';3 4<NavigationContainer ref={navigationRef}>5  <Stack.Navigator>6    {/* …your screens… */}7    <Stack.Screen name="ActiveCallScreen" component={ActiveCallScreen} options={{gestureEnabled: false}} />8  </Stack.Navigator>9  <ChatProvider config={chatConfig} withSafeArea={false} withGestureRoot={false} withToast={false}>10    <CallProvider navigationRef={navigationRef}>{null}</CallProvider>11  </ChatProvider>12</NavigationContainer>

Mount one CallProvider at a time — render the root one only while no ChatNavigator is mounted.

Post-login navigation.reset(...) calls must keep an open ActiveCallScreen route: a call answered from a killed app is often in progress before your app has finished signing in (CallProvider reopens the screen if a reset drops it).

Custom navigator (advanced)

Register the exported screens (ConversationListScreen, ChatRoomScreen, ChatInfoScreen, CreateGroupScreen, SelectUserScreen, SelectGroupMembersScreen, GlobalMessageSearchScreen, NotificationSettingsScreen, MentionsScreen, CanvasListScreen, CanvasEditorScreen, CallsHistoryScreen, ActiveCallScreen) under the AppScreen.* names — screens navigate to each other by those names — and mount CallProvider with your navigationRef. Param types: ChatStackParamList, ChatRoomParams, ChatInfoParams, CreateGroupParams, SelectGroupMembersParams, CanvasListParams, CanvasEditorParams, CallsHistoryParams. CallRecordingsScreen is not exported from the package root, so the room menu's Recordings entry only works inside ChatNavigator — hide it with roomOptions: {recordings: false} otherwise.

PreviousFirebase, APNs & backend setupNextSession, auth & Socket.IO

On this page

ChatNavigator (recommended)Nested inside your own navigatorApp-wide chat session (calls / push from any screen)Custom navigator (advanced)
Back to top