0

I am implementing Firebase push notification. It has 2 action buttons Accept and Decline, And it is an array coming from data payload.

When push triggers, It is displaying only Decline button. Not showing both the buttons.

Below is my code

  NotificationCompat.Builder(this, channelId)
                .setSmallIcon(R.drawable.push_small_icon)
                .setStyle(NotificationCompat.BigPictureStyle().bigPicture(bitmap))
                .setContentTitle(remoteMessage.data[Const.TITLE])
                .setContentText(remoteMessage.data[Const.MESSAGE])
                .setPriority(Notification.PRIORITY_MAX)
                .addAction(action) // Action buttons
                .setAutoCancel(true)`enter code here`
                .setSound(defaultSoundUri)
                .setContentIntent(pendingIntent)

Please help me with this issue.

Thanks

Catcaty
  • 63
  • 1
  • 8
  • Did you find any solution for this issue ? I can add multiple action buttons but if user clicks any button, buttons of all other similar notifications are getting disabled. – Khushbu Shah Aug 04 '21 at 08:31

1 Answers1

0

Try this, show more Notification with multiple buttons

notificationBuilder.addAction(R.drawable.delete, "Delete", PendingIntent.getActivity(this, CANCELNOTIFICATIONID, deleteIntent, 0));
notificationBuilder.addAction(R.drawable.archive, "Archive", PendingIntent.getActivity(this, CANCELNOTIFICATIONID, archiveIntent, 0));
Atik Faysal
  • 158
  • 1
  • 13