# Discourse iOS 应用在返回论坛选择屏幕前不会清除通知

**URL:** https://meta.discourse.org/t/discourse-ios-app-doesnt-clear-notifications-until-you-return-to-the-forum-selection-screen/206169
**Category:** Bug
**Tags:** discourse-hub
**Created:** [2021年十月15日 17:55 UTC](https://meta.discourse.org/t/discourse-ios-app-doesnt-clear-notifications-until-you-return-to-the-forum-selection-screen/206169 "2021-10-15T17:55:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [2021年十月15日 17:55 UTC](https://meta.discourse.org/t/discourse-ios-app-doesnt-clear-notifications-until-you-return-to-the-forum-selection-screen/206169/1 "2021-10-15T17:55:31Z")

</div>

我在 Discourse iOS 应用中配置了几个论坛，以便它们都能向我发送通知。Discourse 应用位于我的主屏幕上，因此我会看到那里有一个红色数字。

但有一个烦人的问题：当我清除通知时，红色数字不会自动消失；我必须返回到论坛选择屏幕才能真正清除通知。

复现步骤：

1. 在 Discourse iOS 应用中至少注册两个论坛。
2. 接收其中一个论坛的通知。（此时，iOS 主屏幕上的应用图标会显示一个红色数字。）
3. 点击 Discourse iOS 应用。您将看到其中一个论坛的通知。
4. 点击该论坛，然后点击右上角的通知数字，并选择“全部清除”。至此，从 Discourse 的角度来看，您的通知已清除。
5. 在不返回论坛选择屏幕的情况下，按下 iOS 主屏幕按钮（或从底部向上滑动）返回 iOS 主屏幕。

预期结果：既然我已在论坛中清除了通知，应用的红色数字应当消失。

实际结果：红色数字依然存在。如果您再次点击该应用，会回到该论坛，但其中已无通知。您必须使用右下角的下拉箭头返回论坛选择屏幕，这将刷新通知列表。只有当论坛选择屏幕上的数字消失后，红色数字才会消失。

我希望论坛的 WebView 能够检测到它是在 Discourse 应用内部被查看的；如果在论坛中清除了通知，它应该向应用发送消息，邀请应用在后台刷新该论坛的通知数字。

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [2021年十月27日 21:56 UTC](https://meta.discourse.org/t/discourse-ios-app-doesnt-clear-notifications-until-you-return-to-the-forum-selection-screen/206169/4 "2021-10-27T21:56:39Z")

</div>

我也注意到了这一点，但从未想过要报告它。

有时在清除通知或显示新的 (x) 提示时会有延迟。

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2022年二月9日 08:52 UTC](https://meta.discourse.org/t/discourse-ios-app-doesnt-clear-notifications-until-you-return-to-the-forum-selection-screen/206169/5 "2022-02-09T08:52:03Z")

</div>

iOS 应用的测试版已发布，其中包含此问题的修复程序：[https://testflight.apple.com/join/5CUCQhCq](https://testflight.apple.com/join/5CUCQhCq)

请注意，您的 Discourse 网站也需要保持最新，并且此修复程序仅适用于用户菜单中的“Dismiss”（关闭）按钮。

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2022年三月9日 22:29 UTC](https://meta.discourse.org/t/discourse-ios-app-doesnt-clear-notifications-until-you-return-to-the-forum-selection-screen/206169/7 "2022-03-09T22:29:50Z")

</div>

DiscourseHub 1.8.2 包含此功能，现已在 App Store 中提供。
