Skip to content

React Native

@aw-chat/react-native renders the SDK with native components onlyView, FlatList, TextInput, Modal, react-native-svg. No WebView.

Install

bash
pnpm add @aw-chat/react-native react-native-svg

react-native-svg is a peer dependency (already present in Expo apps).

Mount

tsx
import { AWChat } from "@aw-chat/react-native";

export function SupportScreen() {
  return (
    <AWChat
      userId={user.id}
      sessionToken={user.token}
      serverUrl="https://chat.antarcticwallet.com"
      telemetry={{ appVersion: "6.1.4", hardwareId: "iPhone15,2", osVersion: "iOS 17.4", deviceLang: "ru" }}
      fcmToken={fcmToken}
      theme="light"
      locale="ru"
    />
  );
}

The component fills its parent — render it inside a flex container (e.g. a SafeAreaView with flex: 1).

The SDK manages its own internal navigation (hub → chat / ticket / complaint) with a back button, and handles the Android hardware back button (returns to the hub before exiting). You don't wire any navigation yourself.

Push (FCM)

Pass the device's fcmToken to register it for push. On logout, unmount the component (the SDK clears its session). Push deep links arrive as { type, conversationId, ticketId } — route them with initialRoute + targetId when re-mounting.

Offline

The SDK already backs off polling on network failure and shows a session-expired panel. A full offline panel requires @react-native-community/netinfo (optional). If you install it, wire it to surface the offline state; otherwise the adaptive back-off keeps things stable until connectivity returns.

Expo

Works out of the box in Expo (SDK 52+). The repo's examples/react-native is an Expo app; it also has a react-native-web preview for fast browser review.

AW Chat SDK — internal integration docs.