分别来自每个聊天室的fcm消息分组

问题描述 投票:0回答:1

我已经成功发送/接收来自fcm组的信息

问题是:] >>

我需要收集来自同一组的消息,例如Facebook Messenger:应用程序名称,然后是聊天室名称,然后是来自同一房间的消息*

示例:

我需要代替当前附加照片中的分隔消息:
Learning ways  <<the name of app
num2           <<room name 
Mon: 6         <<message1
Mon: 7         <<message2
Mon: 8         <<message3

当前通知呼叫:

  @RequiresApi(api = Build.VERSION_CODES.KITKAT_WATCH)
    private void showOreoNotification() {


        OreoNotification oreoNotification = new OreoNotification(this);
        Notification.Builder builder = oreoNotification.getOreoNotification(title, sender_name + body, pendingIntent,
                defaultSound, icon).setLargeIcon(senderImages);
        oreoNotification.getManager().notify(i, builder.build());
        i++;
    }

  private void showOLdNotifications() {


        assert icon != null;
        NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
                .setSmallIcon(Integer.parseInt(icon))
                .setContentTitle(title)
                .setContentText(sender_name + body)
                .setAutoCancel(true)
                .setSound(defaultSound)
                .setContentIntent(pendingIntent).setLargeIcon(senderImages);
        NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        assert notificationManager != null;
        notificationManager.notify(i, notificationBuilder.build());

        i++;
    }

“文本”

我已经成功地从fcm组发送/接收,问题是:我需要收集来自同一组的消息,就像Facebook Messenger:应用程序名称,然后聊天...

firebase-cloud-messaging grouping chat
1个回答
0
投票
您可以使用InboxStyle for Android 4.1+]

消息格式:

© www.soinside.com 2019 - 2024. All rights reserved.