Support chat inside your Expo or React Native app.
Keep help in your app’s navigation. Macaron’s React Native source component sends customer messages to your inbox using native views, without embedding a support website in a WebView.
Add your mobile app freeBy Macaron · Updated
1. Create your app workspace and enable chat
In Macaron, choose Apps → Add app → App, then Expo / React Native. Enter the product name, review and create it. Open Set up chat, enable customer chat and choose Expo / React Native. Keep the displayed public app ID for the component below.
Use your existing React Native or Expo project and a support screen in its navigation. No model key or billing connection is needed for text chat. A public HTTPS Macaron server must be reachable from the simulator or device.
2. Add the source to your support screen
Add the product in Macaron as an Expo / React Native app, enable customer chat and download MacaronSupport.tsx from Set up chat. This is editable source, not an npm package. Copy it into your project and render it in your own screen and safe-area container.
This starter opens basic chat with no additional native module in the chat component itself. Replace YOUR_APP_ID with the ID from setup. Keep the public HTTPS Macaron origin reachable from the device; localhost on a physical phone refers to that phone, not your development laptop.
import { MacaronSupport } from "./MacaronSupport";
export default function SupportScreen() {
return (
<MacaronSupport
baseUrl="https://macaron.sh"
appId="YOUR_APP_ID"
context="Support screen"
/>
);
}Handle screen focus and restore the right session
A navigator may leave a screen mounted after the customer leaves it. Pass active={isSupportScreenFocused}, using your navigator’s focus state, so hidden chat does not mark messages read. The component’s periodic refresh also checks whether the app is in the foreground. Test returning from the background rather than assuming a mounted screen is visible.
The minimal example keeps the conversation session in memory. To restore it after relaunch, save the { id, token } object delivered to onSession using your app’s secure storage, then supply it as initialSession. Finish restoring storage before mounting chat. Handle storage failures in your host app; do not silently discard a customer’s access token.
Keep stored sessions separate per Macaron app and signed-in customer. Remount with a key derived from both when either changes, and clear or switch the restored session on sign-out. A display name or a supplied context string is not verified identity; do not use either as authorization to perform an account or billing action.
Expo SecureStore is one host-app option for encrypted local storage. It is separate from the chat source and has its own installation and platform behavior. Follow its documentation for your Expo version and test reinstall, logout and account switching.
3. Verify delivery on the platforms you ship
A successful web or hosted test does not verify your native build. Exercise the app’s keyboard, navigation and network behavior on each supported platform before inviting customers to rely on it.
- Open the installed support screen and send a synthetic message naming the app build and platform.
- Find it in the correct Macaron product inbox, reply and confirm the reply appears in the app.
- In Set up chat, choose Check delivery. Confirm customer message received, team reply sent and reply loaded for the same conversation.
- Leave the support screen, then return. Check unread behavior and confirm one conversation remains attached to the restored session.
- Background and reopen the app. Relaunch it if you implemented session persistence, and test switching customer accounts.
- Check a failed connection and retry with the same draft. Run the checks on both iOS and Android if you distribute both builds.
Keep branding, push and fixes explicit
Keep your own support entry point, navigation and safe-area container. The downloaded source is editable, and the product’s configured logo and accent are used by chat. Use a short context string for a screen or build, not passwords, payment data or authentication tokens.
Basic chat uses text messages and foreground polling. Installing this component does not enable push notifications, purchase restoration or native review prompts. Those features need their own host-app integration and delivery checks; do not infer them from a successful text message.
If a customer reports a bug, keep the app version, platform, reproduction steps and expected result with a fix report. Preparing code work needs repository, machine and model access. A finished coding run is not a verified device fix; repeat the original steps in the actual build.