-
public class NotificationActionsFactoryFactory for creating NotificationCompat.Action instances used in chat push notifications.
This factory provides convenient methods to create common notification actions such as "Mark as Read" and "Reply" with sensible defaults, while allowing full customization.
-
-
Field Summary
Fields Modifier and Type Field Description public final static NotificationActionsFactoryINSTANCE
-
Method Summary
Modifier and Type Method Description final NotificationCompat.ActioncreateMarkReadAction(Context context, Integer notificationId, Channel channel, Message message, @DrawableRes() Integer icon, String title, PendingIntent pendingIntent)Creates a "Mark as Read" notification action. final NotificationCompat.ActioncreateReplyAction(Context context, Integer notificationId, Channel channel, @DrawableRes() Integer icon, String title, String hint, PendingIntent pendingIntent)Creates a "Reply" notification action with inline reply support. -
-
Method Detail
-
createMarkReadAction
final NotificationCompat.Action createMarkReadAction(Context context, Integer notificationId, Channel channel, Message message, @DrawableRes() Integer icon, String title, PendingIntent pendingIntent)
Creates a "Mark as Read" notification action.
When triggered, this action marks the specified message as read in the channel.
- Parameters:
context- The Context used to access resources and create the pending intent.notificationId- The unique identifier for the notification.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.title- The label text displayed on the action button.pendingIntent- The PendingIntent to execute when the action is triggered.
-
createReplyAction
final NotificationCompat.Action createReplyAction(Context context, Integer notificationId, Channel channel, @DrawableRes() Integer icon, String title, String hint, PendingIntent pendingIntent)
Creates a "Reply" notification action with inline reply support.
This action displays an inline text input field (on supported devices) allowing users to reply directly from the notification without opening the app.
- Parameters:
context- The Context used to access resources and create the pending intent.notificationId- The unique identifier for the notification.channel- The Channel to send the reply message to.icon- The drawable resource ID for the action icon.title- The label text displayed on the action button.hint- The placeholder text shown in the inline reply input field.pendingIntent- The PendingIntent to execute when the reply is submitted.
-
-
-
-