Skip to content

Commit ef1eea3

Browse files
authored
chore: add universal linking guide (#565)
1 parent 4c9ac59 commit ef1eea3

1 file changed

Lines changed: 107 additions & 0 deletions

File tree

contributing-guide/mobile-app/setup-guide.mdx

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,113 @@ Once both values are set, the server will send push notifications directly to FC
201201
Push notifications do not work on iOS simulators. You must use a physical device to test.
202202
</Note>
203203

204+
## Deep linking
205+
206+
Deep linking allows users to tap a Chatwoot conversation URL (or a push notification) and be taken directly to that conversation in the mobile app. The app supports two mechanisms:
207+
208+
- **Custom URL scheme**: `chatwootapp://` — used for SSO callbacks and internal routing.
209+
- **Universal Links (iOS) / App Links (Android)**: `https://<your-domain>/app/accounts/*/conversations/*` — used for opening web URLs directly in the app.
210+
211+
### How it works
212+
213+
When the app receives a deep link, React Navigation matches it against the configured path pattern and navigates to the conversation screen:
214+
215+
```
216+
https://<your-domain>/app/accounts/{accountId}/conversations/{conversationId}
217+
```
218+
219+
This works across all app states — whether the app is in the foreground, backgrounded, or was terminated. Push notification taps also use this same flow to navigate to the relevant conversation.
220+
221+
### Configuring deep links for custom builds
222+
223+
If you are building a custom-branded app with your own domain, you need to configure both the mobile app and the Chatwoot server so that deep links resolve correctly.
224+
225+
#### Mobile app configuration
226+
227+
The app uses Expo's built-in deep linking support. In `app.config.ts`, update the following to match your domain and bundle identifiers:
228+
229+
<Tabs>
230+
<Tab title="iOS">
231+
232+
Update the [associated domain](https://docs.expo.dev/linking/ios-universal-links/) to your Chatwoot installation URL:
233+
234+
```typescript
235+
ios: {
236+
associatedDomains: ['applinks:your-domain.com'],
237+
}
238+
```
239+
240+
Expo prebuild writes this into the `.entitlements` file automatically.
241+
242+
</Tab>
243+
<Tab title="Android">
244+
245+
Update the [intent filter](https://docs.expo.dev/linking/android-app-links/) host to your Chatwoot installation URL:
246+
247+
```typescript
248+
android: {
249+
intentFilters: [
250+
{
251+
action: 'VIEW',
252+
autoVerify: true,
253+
data: [
254+
{
255+
scheme: 'https',
256+
host: 'your-domain.com',
257+
pathPrefix: '/app/accounts/',
258+
},
259+
],
260+
category: ['BROWSABLE', 'DEFAULT'],
261+
},
262+
],
263+
}
264+
```
265+
266+
Expo prebuild writes this into the `AndroidManifest.xml` automatically.
267+
268+
</Tab>
269+
</Tabs>
270+
271+
After making changes, regenerate the native code:
272+
273+
```bash
274+
pnpm generate
275+
```
276+
277+
#### Server configuration
278+
279+
The Chatwoot server dynamically serves the verification files that Android and iOS require to confirm your app owns the domain. Configure the following environment variables on your Chatwoot installation:
280+
281+
<Tabs>
282+
<Tab title="iOS">
283+
284+
The server serves an `apple-app-site-association` file at `https://<your-domain>/.well-known/apple-app-site-association`. No additional configuration is needed beyond ensuring your Chatwoot installation is accessible at the domain specified in `associatedDomains`.
285+
286+
</Tab>
287+
<Tab title="Android">
288+
289+
Set the following environment variables with your app's package name and signing certificate fingerprint:
290+
291+
```bash
292+
ANDROID_BUNDLE_ID=com.yourcompany.app
293+
ANDROID_SHA256_CERT_FINGERPRINT=YOUR:SHA256:CERT:FINGERPRINT
294+
```
295+
296+
This is served at `https://<your-domain>/.well-known/assetlinks.json` and tells Android to open matching URLs in your app.
297+
298+
To obtain your SHA-256 certificate fingerprint, run:
299+
300+
```bash
301+
keytool -list -v -keystore your-keystore.jks -alias your-alias
302+
```
303+
304+
</Tab>
305+
</Tabs>
306+
307+
<Note>
308+
If you are using the official Chatwoot mobile app with `app.chatwoot.com`, deep linking works out of the box with no additional configuration.
309+
</Note>
310+
204311
## Build & Submit using EAS
205312

206313
We use Expo Application Services (EAS) for building, deploying, and submitting the app to app stores. EAS Build and Submit is available to anyone with an Expo account, regardless of whether you pay for EAS or use our Free plan.

0 commit comments

Comments
 (0)