Skip to content

Commit fefd8f1

Browse files
committed
chore: update push guide
1 parent 38a88f1 commit fefd8f1

File tree

1 file changed

+85
-3
lines changed

1 file changed

+85
-3
lines changed

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

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,93 @@ npx expo install package-name
113113
pnpm install package-name
114114
```
115115

116-
## Push notification
116+
## Push notifications
117117

118-
If you are using the community edition of Chatwoot, you can now use the [official mobile app](https://www.chatwoot.com/mobile-apps) with push notifications without any additional configuration.
118+
Chatwoot supports mobile push notifications through Firebase Cloud Messaging (FCM). There are two delivery paths depending on your setup:
119119

120-
For more details, please refer to the [push notification documentation](https://www.chatwoot.com/hc/handbook/articles/1687935909-push-notification).
120+
- **Relay server (default)**: Self-hosted instances without Firebase credentials route notifications through the Chatwoot relay server, which forwards them to the **official Chatwoot mobile app**.
121+
- **Direct FCM**: Instances with Firebase configured send notifications directly to your **custom-built mobile app**.
122+
123+
<Note>
124+
You must use either the official apps for both platforms or custom builds for both — mixing is not supported. For more details, refer to the [push notification documentation](https://www.chatwoot.com/hc/handbook/articles/1687935909-push-notification).
125+
</Note>
126+
127+
### Using the official mobile app
128+
129+
If you are using the community edition of Chatwoot with the [official mobile app](https://www.chatwoot.com/mobile-apps), push notifications work out of the box with no additional configuration. The relay server is enabled by default (`ENABLE_PUSH_RELAY_SERVER=true`).
130+
131+
### Setting up Firebase for custom builds
132+
133+
If you are building a custom-branded mobile app, you need to configure Firebase on both the mobile app and the Chatwoot server.
134+
135+
#### Step 1: Create a Firebase project
136+
137+
1. Go to the [Firebase Console](https://console.firebase.google.com/) and create a new project (or use an existing one).
138+
2. Register your Android app with your package name (e.g., `com.yourcompany.app`).
139+
3. Register your iOS app with your bundle identifier (e.g., `com.yourcompany.app`).
140+
141+
#### Step 2: Download Firebase config files
142+
143+
Download the platform-specific configuration files from your Firebase project settings:
144+
145+
<Tabs>
146+
<Tab title="Android">
147+
1. In **Project Settings > General**, find your Android app and click **Download google-services.json**.
148+
2. Place the file in the root of the mobile app repository.
149+
</Tab>
150+
<Tab title="iOS">
151+
1. In **Project Settings > General**, find your iOS app and click **Download GoogleService-Info.plist**.
152+
2. Place the file in the root of the mobile app repository.
153+
</Tab>
154+
</Tabs>
155+
156+
#### Step 3: Configure mobile app environment variables
157+
158+
Update your `.env` file to point to the Firebase config files:
159+
160+
```bash
161+
EXPO_PUBLIC_ANDROID_GOOGLE_SERVICES_FILE=./google-services.json
162+
EXPO_PUBLIC_IOS_GOOGLE_SERVICES_FILE=./GoogleService-Info.plist
163+
```
164+
165+
Then regenerate the native code so the new config is picked up:
166+
167+
```bash
168+
pnpm generate
169+
```
170+
171+
#### Step 4: Generate a Firebase service account
172+
173+
The Chatwoot server needs a service account to send push notifications via the FCM v1 API.
174+
175+
1. In the Firebase Console, go to **Project Settings > Service accounts**.
176+
2. Click **Generate new private key** to download a JSON credentials file.
177+
178+
<Warning>
179+
Keep this file secure. It grants access to send push notifications on behalf of your Firebase project.
180+
</Warning>
181+
182+
#### Step 5: Configure the Chatwoot server
183+
184+
In your Chatwoot installation, navigate to **Super Admin > App Config** and set the following:
185+
186+
| Config key | Value |
187+
| ----------------------- | --------------------------------------------------------- |
188+
| `FIREBASE_PROJECT_ID` | Your Firebase project ID (e.g., `my-project-12345`) |
189+
| `FIREBASE_CREDENTIALS` | The full contents of the service account JSON file |
190+
191+
Once both values are set, the server will send push notifications directly to FCM instead of using the relay server.
192+
193+
#### Verifying the setup
194+
195+
1. Build and install the custom app on a device (`pnpm run:ios` or `pnpm run:android`).
196+
2. Log in to your Chatwoot instance from the mobile app.
197+
3. From another browser session, send a message to a conversation assigned to the logged-in agent.
198+
4. The device should receive a push notification.
199+
200+
<Note>
201+
Push notifications do not work on iOS simulators. You must use a physical device to test.
202+
</Note>
121203

122204
## Build & Submit using EAS
123205

0 commit comments

Comments
 (0)