SDK & Widget · Mobile
Push notifications
Reach visitors who have closed your app. Let Inboxi send pushes with your Firebase / APNs credentials, or receive webhooks and send them yourself.
When your team replies to a widget or SDK conversation and the visitor is no longer connected, Inboxi can deliver the reply as a push notification. "No longer connected" means the visitor joined the chat over Socket.IO (as ChatScreen does) and that socket has since closed, for example because the app went to the background. There are two ways to set it up.
| Direct push (recommended) | Webhooks (advanced) | |
|---|---|---|
| Who sends the push | Inboxi, with your FCM / APNs credentials | Your server |
| Setup | Upload credentials, register device tokens | Subscribe to webhook events, map contacts to devices |
| Covers | Replies your team sends from the inbox to widget / SDK chats | Events Inboxi emits as webhooks (see note below) |
| Control over content | Agent name as title, reply text as body | Full control |
| Best for | SDK chat replies (most apps) | Apps with an existing notification service |
Method 1: Direct push
- 1Developer Hub › Documentation › Push Notifications.
- 2Credentials are entered on the Credentials & Setup tab.
- 3Register each device token from your app.
- 1Open Credentials & SetupGo to Settings › Developer Hub › Credentials & Setup and find the Push Notifications card.
- 2Android: upload your FCM service accountIn the Firebase console open Project Settings › Service Accounts, choose Generate new private key, and upload the downloaded JSON file.
- 3iOS: enter your APNs key detailsIn your Apple Developer account create an APNs key (Certificates, Identifiers & Profiles › Keys), then enter the Team ID, Bundle ID and Key ID.
- 4Enable and saveTurn on Enable Push Notifications and click Save Push Settings.
- 5Register device tokensFrom the app, after
init, send each device's token to/sdk/device-token(orInboxiChat.setDeviceToken).
import { Platform } from 'react-native';
import messaging from '@react-native-firebase/messaging';
await messaging().requestPermission();
const fcmToken = await messaging().getToken();
await InboxiChat.setDeviceToken(fcmToken, Platform.OS); // 'ios' | 'android'
// Keep it fresh when Firebase rotates the token
messaging().onTokenRefresh((t) => InboxiChat.setDeviceToken(t, Platform.OS));What the notification contains
{
"title": "Sara (your teammate's name)",
"body": "Your order has shipped and will arrive tomorrow…",
"data": { "chatId": "456", "type": "new_message", "agentName": "Sara" }
}The body is the reply text, cut at 100 characters. Use data.chatId to open the right conversation when the user taps the notification.
platform: 'ios' are delivered through APNs, which also needs your APNs auth key (.p8). If iOS notifications do not arrive after you saved the Team ID, Bundle ID and Key ID, contact support to attach the key, or use the webhook method. Tokens that the provider reports as invalid are deactivated automatically.Method 2: Webhooks
If you already run your own notification service, subscribe your server to Inboxi webhooks (in Settings › Developer Hub › Webhooks or through the API) and send pushes from your own Firebase project. Chat-scoped events include a contact block with the externalUserId you passed to identify, so you can find the user's devices without another API call.
message.sent fires for messages your systems send through the REST API (Messages). Replies typed in the inbox or written by the AI agent in a widget conversation do not fire it, so for chat replies to SDK visitors use direct push (Method 1).{
"event": "message.sent",
"timestamp": "2026-04-09T12:00:05.000Z",
"data": {
"chatId": 456,
"to": "+201234567890",
"message": "Your order has shipped",
"contact": {
"chatId": 456,
"name": "Mohamed Ali",
"phone": "+201234567890",
"email": "mohamed@example.com",
"externalUserId": "user_123",
"customData": { "plan": "premium" }
}
}
}app.post('/inboxi-webhook', async (req, res) => {
// Verify X-Inboxi-Signature first (see the Webhooks guide)
const { event, data } = req.body;
if (event === 'message.sent' && data.contact?.externalUserId) {
const tokens = await getDeviceTokens(data.contact.externalUserId);
await admin.messaging().sendEachForMulticast({
tokens,
notification: { title: 'New message from Support', body: String(data.message).slice(0, 100) },
data: { chatId: String(data.chatId) },
});
}
res.sendStatus(200);
});Read Webhooks for signature verification, retries and the full event list.
Troubleshooting
- No push while testing: close the chat screen first. A visitor with an open socket is online and gets the reply live instead.
- Check that Enable Push Notifications is on and the credentials were saved.
- Register the token after init, with the right platform value. A token registered for one visitor moves to whoever registers it next.
- Android notifications need the POST_NOTIFICATIONS permission on Android 13 and later; iOS needs the user to grant notification permission.