Abrova
☰ Docs menu · Conversation notifications

Conversation notifications

View as Markdown

Show chat messages like a messenger does: the sender's photo, one notification per conversation, and on Android the chat in the phone's Conversations section. Add a few keys to the message data; the SDKs do the rest.

A chat message should look like a chat message.

A normal push shows your app's icon, and every message is its own notification. For a chat, people expect the sender's face and the messages of one conversation together, as in the big messengers. Add a conversationId (and the sender) to the message data and the Abrova Push SDKs show it that way. Messages without conversationId look exactly as before.

Step 1: Add the conversation to the message data#

Key in dataWhat it does
conversationIdRequired. One conversation per id, for example your chat or room id. New messages with the same id join the same notification.
senderNameWho wrote the message. Without it, the title is used.
senderIdTells two senders with the same name apart.
senderAvatarUrlAn https image for the sender’s photo. Without it, Android draws a round letter.
conversationTitleThe group’s name, shown for groups.
conversationIsGrouptrue for a group conversation.

From your server:

bash
curl -X POST https://push-api.abrova.ir/push/send-to-user \
  -H "x-api-key: $ABROVA_API_KEY" \
  -H "x-server-secret: $ABROVA_SERVER_SECRET" \
  -H "content-type: application/json" \
  -d '{"userId":"user_kian","title":"@ali","body":"Is the bike still available?",
       "data":{"conversationId":"room_42","senderName":"@ali","senderId":"user_ali",
               "senderAvatarUrl":"https://cdn.example.com/avatars/ali.jpg"}}'

With the Node.js SDK, conversationData() builds the keys:

typescript
import { AbrovaPush, conversationData } from '@abrova/push-node';

await push.send({
  userId: 'user_kian',
  title: '@ali',
  body: 'Is the bike still available?',
  data: {
    ...conversationData({ id: 'room_42', senderName: '@ali', senderId: 'user_ali', senderAvatarUrl: 'https://cdn.example.com/avatars/ali.jpg' }),
    roomId: 'room_42',
  },
});

For a group, add isGroup: true and title: 'Family' (or the keys conversationIsGroup and conversationTitle).

Using Abrova Chat?

Chat already sends conversationId, senderName, senderId and, for groups, the group's name with every message push. Only the photo is yours, because Chat stores no pictures: put senderAvatarUrl in the message's metadata.pushData when you send it. See Chat push notifications.

Step 2: iOS: two setup steps#

Android, the web and Flutter on Android need nothing more. On iOS the sender's photo is a communication notification, which Apple only allows when the app asks for it:

  1. In Xcode, select your app target and add the Communication Notifications capability. In the app's Info.plist, add NSUserActivityTypes with the item INSendMessageIntent.
  2. In your Notification Service Extension (the one with pod 'AbrovaPushSDKExtension', see iOS SDK), pass the content through the SDK:
swift
override func didReceive(_ request: UNNotificationRequest,
                         withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
    AbrovaPushServiceExtension.conversationContent(for: request) { contentHandler($0) }
}

If you also confirm deliveries there, call AbrovaPushServiceExtension.didReceive(request, apiKey:appGroup:) first. Flutter and React Native apps do the same in their iOS project.

Without step 1, iOS still groups the conversation's messages together, without the photo.

Step 3: What people see#

  • Android: the sender's round photo instead of the app icon, the conversation's messages stacked in one notification, and the group name for groups. On Android 11 and later the chat sits in the Conversations section at the top of the notification list, and on Samsung's small pop-up style it shows the sender's face. Tapping it opens your app with the message data, as before.
  • iOS 15 and later: the sender's photo and name on the notification, and the conversation's notifications grouped together.
  • Web: one notification per conversation. A new message replaces it and keeps the earlier lines (up to 5), with the sender's photo as the icon. A group shows its name and sender: text lines.
SDK versions.

Conversation notifications need Android SDK 0.1.22, iOS SDK 0.1.21, Flutter 0.1.31, React Native 0.1.22 or Web 0.1.15 (conversationData() is in Node.js 0.1.9). Older SDKs ignore the keys and show the message as a normal notification.

Was this page helpful?
Report a problem

Last updated: 15 Nov 2026