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

オープン
#6,842 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@DSingh0304 がすでに取り組んでいます。

2025年12月9日 から。

  • #6867 @DSingh0304 による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
android, ios, react-native, swift, typescript
領域
mobile, mobile-dev

調査の方向性

まず app/lib/notifications/push.ts と ios/ReplyNotification.swift から始め、既存の REPLY_ACTION handler と、subscriptions.read API の使用箇所について app/lib/methods/readMessages.ts を調べます。通知 payload が rid をどのように提供するか、また両プラットフォームでフォアグラウンドとバックグラウンドのアクションがどのように処理されるかを追跡します。Mark as Read アクションが subscriptions.read を呼び出し、room の通知と未読状態をクリアし、フォアグラウンドとバックグラウンドの両方で動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

🎉 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 !!

主要言語
TypeScript
スター
2.4k
フォーク
1.5k
平均マージ
1日 15時間
マージ済み PR(30日)
29

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RocketChat/Rocket.Chat.ReactNative のほかの issue

RocketChat/Rocket.Chat.ReactNative の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。