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 pushInboxi, with your FCM / APNs credentialsYour server
SetupUpload credentials, register device tokensSubscribe to webhook events, map contacts to devices
CoversReplies your team sends from the inbox to widget / SDK chatsEvents Inboxi emits as webhooks (see note below)
Control over contentAgent name as title, reply text as bodyFull control
Best forSDK chat replies (most apps)Apps with an existing notification service

Method 1: Direct push

inboxi.app/settings/developer
The Push Notifications guide in the Developer Hub.
  1. 1Developer Hub › Documentation › Push Notifications.
  2. 2Credentials are entered on the Credentials & Setup tab.
  3. 3Register each device token from your app.
  1. 1
    Open Credentials & Setup
    Go to Settings › Developer Hub › Credentials & Setup and find the Push Notifications card.
  2. 2
    Android: upload your FCM service account
    In the Firebase console open Project Settings › Service Accounts, choose Generate new private key, and upload the downloaded JSON file.
  3. 3
    iOS: enter your APNs key details
    In your Apple Developer account create an APNs key (Certificates, Identifiers & Profiles › Keys), then enter the Team ID, Bundle ID and Key ID.
  4. 4
    Enable and save
    Turn on Enable Push Notifications and click Save Push Settings.
  5. 5
    Register device tokens
    From the app, after init, send each device's token to /sdk/device-token (or InboxiChat.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

json
{
  "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.

iOS tokens
Tokens registered with 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.

Which replies fire message.sent
Today 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).
POST https://your-server.com/inboxi-webhook
{
  "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" }
    }
  }
}
Your server
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.