Other platforms
Show the chat in a Flutter, native iOS or Android app, or anything that can show a web page.
Any web view can do what the React Native screen does.
Steps
- Load
https://support.example.com/embed?source=<source>in a web view, with JavaScript and DOM storage on. The source must be one the install knows. - Expose
window.ReactNativeWebView.postMessage(text)to the page. The chat sends its messages to it as JSON strings. The first is{ "channel": "helpwren", "type": "ready" }. - Answer by running
window.dispatchEvent(new MessageEvent("message", { data: <message> }))in the page: sendhello, thenidentifywith the user's token,context, andopenfor a conversation. - Listen for
unread,identityandclose.
Every message is defined in
packages/widget/src/protocol.ts. For push, see
Firebase or Your own backend.