feature: Add "Mark as Read" action button to push notifications

Đang mở
#6,842 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@DSingh0304 đang làm issue này rồi.

Từ ngày 9/12/2025.

  • #6867 của @DSingh0304 — đã đóng, không merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
android, ios, react-native, swift, typescript
Lĩnh vực
mobile, mobile-dev

Hướng nghiên cứu

Bắt đầu với app/lib/notifications/push.ts và ios/ReplyNotification.swift, sau đó kiểm tra handler REPLY_ACTION hiện có và app/lib/methods/readMessages.ts để xem cách sử dụng API subscriptions.read. Theo dõi cách các payload thông báo cung cấp rid và cách các action ở foreground và background được xử lý trên cả hai nền tảng. Hoàn tất khi action Mark as Read gọi subscriptions.read, xóa thông báo của room và trạng thái chưa đọc, đồng thời hoạt động ở cả foreground và background.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🎉 feature
Feature Description

Add a "Mark as Read" quick action button to push notifications, similar to WhatsApp, Telegram, and Slack messaging apps. This would allow users to mark messages/rooms as read directly from the notification without opening the app.

Proposed Behavior:
  • When a user receives a chat notification, they would see action buttons including:

    • Reply (already exists)
    • Mark as Read (NEW)
  • Tapping "Mark as Read" would:

    • Call the subscriptions.read API endpoint
    • Clear the unread badge for that room
    • Remove the notification from the notification tray
    • Update the room's read status on the server

This feature would work in both foreground and background states.

Motivation and Use Case
User Pain Points:
  1. Notification Overload: Users often receive many notifications during busy periods and want a quick way to triage them without opening each conversation
  2. Workflow Interruption: Currently, users must open the app and navigate to each room just to mark messages as read, which disrupts their current task
  3. Mobile UX Expectations: Modern messaging apps (WhatsApp, Telegram, Slack, Microsoft Teams) all provide this functionality, making it a standard user expectation
Benefits:

Faster notification management - One tap vs opening app → navigating to room → going back
Reduced app opens - Better battery life and performance
Better focus - Users can clear notifications without context switching
Cleaner notification tray - Reduces notification fatigue
Professional UX - Matches expectations from other enterprise chat apps

Implementation Ideas

Technical Implementation Plan:

Phase 1: iOS (Easier to implement)

  1. Add Notification Action (app/lib/notifications/push.ts)
const markAsReadAction = new NotificationAction(
  'MARK_AS_READ_ACTION', 
  'background',  // Can execute in background
  I18n.t('Mark_as_read'), 
  false  // Doesn't require text input
);

const notificationCategory = new NotificationCategory('MESSAGE', [
  notificationAction,    // Existing Reply action
  markAsReadAction       // NEW action
]);

  1. Add Native Handler (ios/ReplyNotification.swift)

    • Add handler similar to existing REPLY_ACTION
    • Extract rid from notification payload
    • Call subscriptions.read API endpoint
    • Handle success/failure cases
  2. API Integration

    • Endpoint: POST subscriptions.read (already exists!)
    • Parameters: { rid: string, readThreads?: boolean }
    • Auth: Use existing RocketChat helper class

Phase 2: Android

Android requires custom notification channel configuration:

  • Create notification action in Java/Kotlin
  • Wire up to existing API methods
  • Handle background execution

API Requirements:

Good news: The required API already exists!

  • Endpoint: subscriptions.read (available since RC 0.61.0)
  • Current usage: Already used in app/lib/methods/readMessages.ts
  • No server changes needed

API Flow:
Notification Action → Extract rid → POST subscriptions.read { rid } → Update local DB → Clear notification

Edge Cases to Handle:

  1. Network Unavailable:

    • Queue action for retry when connection restored
    • Or show brief error notification
  2. Expired Auth Token:

    • Attempt token refresh
    • Gracefully fail if user needs to re-login
  3. Multiple Notifications from Same Room:

    • Mark all as read when action is triggered on any one
  4. Encrypted Rooms:

    • Works the same way (marks as read, doesn't affect encryption)
Is this feature available in the API or web version?

Available in API

Rocket.Chat Server Version

Any version >= 0.61.0 (subscriptions.read API available)

Rocket.Chat App Version

4.68.0

Device Name

All iOS and Android devices

OS Version

iOS 13+ / Android 7.0+ (notification actions support)

Additional Context
Image

This is the feature i am talking about !!

Ngôn ngữ chính
TypeScript
Star
2.4k
Fork
1.5k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RocketChat/Rocket.Chat.ReactNative

Tất cả issue của RocketChat/Rocket.Chat.ReactNative

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.