Skip to main content
Use this page when you want customers to open chat inside your mobile app. These examples target Widget 5.0.0; check version availability before using the pinned script.
Build one support page, load it in a WebView, and let OpenCX handle the conversation.
Rendering chat with your own React Native components instead of a WebView? Use the headless packages.

What You Are Building

Add a Support screen to your app. That screen opens a WebView pointed at a small HTTPS page with the OpenCX widget already open.

Implementation Steps

1

Create a support page

Host a page like https://app.example.com/mobile-support. Your app will load this URL in a WebView.
2

Add the widget

Give the page a real viewport height. Without this, the widget can load but the chat input may sit too high on the screen.
support.html
3

Open the page from your app

Add a Support button, Help Center row, or Account menu item that opens the WebView.
4

Test the mobile flow

Open the app, start a chat, close the screen, reopen it, and confirm the conversation still feels natural.

Open The WebView

Install react-native-webview first if your app does not already use it.
SupportScreen.tsx

Recognize Signed-In Customers

If customers sign in to your app, pass a verified contact token to the widget. This lets the same customer see their support history across devices.
1

Request a token from your backend

Your backend calls OpenCX with your org API key. Do not call this from the mobile app.
2

Pass the token into the widget

Add the token to your support page config. Your backend can render it into the page or your app can request it before opening the WebView.
Never put your OpenCX API key in the mobile app. Keep it on your backend.

Send Useful Context

Give support enough context to help without asking the customer to repeat themselves.
Keep this clean. Send account IDs, plan names, app version, and the screen the customer came from. Do not send secrets or device identifiers.

Handoff and native notifications

Human replies remain in the same widget session. There is no onHandoff widget option. hooks.onMessageReceived reports new messages and is not an immediate transfer event; do not use it to claim that a transfer has just completed. For a native banner on a delivered human reply, check message.type === 'AGENT' in that hook and send a small event through your WebView bridge. Validate bridge messages and the loaded page origin in your native app. Keep tokens and message content out of bridge events unless your application requires them. When switching accounts or logging out, update the verified widget identity and clear the previous native account’s state. Renew expiring tokens through your backend; see JWT renewal.

Mobile Checklist


Install Widget

Web, React, and headless install paths.

Authentication

Verified contact tokens and history access.

Configuration

Inline mode, routing, theme, and context options.

Headless

Build custom rendering when WebView is not enough.