createMarkReadAction

fun createMarkReadAction(context: Context, notificationId: Int, channel: Channel, message: Message, @DrawableRes icon: Int = android.R.drawable.ic_menu_view, title: String = context.getString(R.string.stream_chat_notification_read), pendingIntent: PendingIntent = createMarkReadPendingIntent(context, notificationId, channel, message)): NotificationCompat.Action

Creates a "Mark as Read" notification action.

When triggered, this action marks the specified message as read in the channel.

Return

A NotificationCompat.Action configured for marking messages as read.

Parameters

context

The Context used to access resources and create the pending intent.

notificationId

The unique identifier for the notification. Used for the pending intent request code.

channel

The Channel containing the message to mark as read.

message

The Message to mark as read when the action is triggered.

icon

The drawable resource ID for the action icon. Defaults to android.R.drawable.ic_menu_view.

title

The label text displayed on the action button. Defaults to the localized "Mark as read" string.

pendingIntent

The PendingIntent to execute when the action is triggered. Defaults to a broadcast intent which will mark the channel as read.