0
私はFirebaseでチャットアプリケーションを作成しています。 Firebase Cloudの機能を使って通知を送信し、電話で受信します。しかし、すべてのメッセージに対して私は新しい通知を受け取ります。そして今、WhatsAppのような通知を作成することが可能かどうか、1つの通知内の各メッセージに複数の行があるかどうかを知りたいと思います。通知のための私のコード:あなたの助けをChatApp:複数の通知
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
String notification_tag = remoteMessage.getData().get("senderUiD");
Intent intent = new Intent(getApplicationContext(), Chat_Room.class);
PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, 0);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(remoteMessage.getData().get("username"))
.setContentText(remoteMessage.getNotification().getBody())
.setVibrate(new long[]{1500, 0, 1500, 0})
.setLights(Color.BLUE, 2000, 1000)
.setWhen(remoteMessage.getSentTime())
.setAutoCancel(true)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setStyle(new NotificationCompat.BigTextStyle().bigText(remoteMessage.getNotification().getBody()))
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setContentIntent(pendingIntent);
notificationManager.notify(notification_tag, 0, notificationBuilder.build());
感謝;)
このリンクを読むことを強くお勧めします。https://stackoverflow.com/questions/33040737/how-to-group-android-notifications-like-whatsapp https://stackoverflow.com/questions/41692501/グループ通知 - アンドロイド –