【发布时间】:2020-06-30 06:21:48
【问题描述】:
我正在实施 Firebase 推送通知。它有 2 个动作按钮 Accept 和 Decline,它是一个来自数据负载的数组。
当按下触发时,它只显示拒绝按钮。两个按钮都没有显示。
下面是我的代码
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)
请帮我解决这个问题。
谢谢
【问题讨论】:
-
你找到解决这个问题的方法了吗?我可以添加多个操作按钮,但如果用户单击任何按钮,所有其他类似通知的按钮都会被禁用。
标签: android push-notification firebase-cloud-messaging action-button