# 2023年iOS 16网页推送通知

**URL:** <https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240>\
**Category:** General\
**Tags:** push-notifications, ios\
**Created:** [2022年六月6日 19:07 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240 "2022-06-06T19:07:04Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![jtbayly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jtbayly/32/119510_2.png) [@jtbayly](https://meta.discourse.org/u/jtbayly)\
**Post date:** [2022年六月8日 01:28 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/21 "2022-06-08T01:28:55Z")

</div>

> [@agungor](#):
>
> 我主要对实时 iOS 推送通知感兴趣，而不是通过轮询获取的通知。

我也是。尤其是因为非推送通知在 95% 的时间里根本不起作用。

实际上，整个话题都与_推送_通知有关，而您在自托管 Discourse 中根本无法在 iOS 上获得推送通知，除非创建一个单独的 iOS 应用，而该应用可能不会被 App Store 接受。

---

<div class="post-metadata">

**Author:** ![Decorbuz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/decorbuz/32/235124_2.png) [@Decorbuz](https://meta.discourse.org/u/Decorbuz)\
**Post date:** [2022年六月8日 02:39 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/22 "2022-06-08T02:39:22Z")

</div>

> [@featheredtoast](#):
>
> 顺便说一句，没有计划放弃移动应用程序，它仍然非常有用，可以让你将所有的 discourse 站点和通知聚合到一个地方，并且可以独立于接收实时通知。

哦，我很高兴听到它没有被砍掉！@jimkleiber 提出了一个关于此的观点。

---

<div class="post-metadata">

**Author:** ![volanar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/volanar/32/318163_2.png) [@volanar](https://meta.discourse.org/u/volanar)\
**Post date:** [2023年一月19日 06:07 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/23 "2023-01-19T06:07:39Z")

</div>

Nodeb 使用 [ntfy](https://ntfy.sh/) [解决了](https://github.com/NodeBB/nodebb-plugin-ntfy) 此问题

---

<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:** [2023年二月15日 22:52 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/24 "2023-02-15T22:52:15Z")

</div>

> [@Discourse offers to enable live notifications on macOS Safari 16, but they don't work](https://meta.discourse.org/t/discourse-offers-to-enable-live-notifications-on-macos-safari-16-but-they-dont-work/249987/11?u=dfabulich):
>
> I got my first macOS Safari push notification today (from today’s [announcement](https://meta.discourse.org/t/custom-sidebar-sections-being-tested-on-meta/255303)). I didn’t have the presence of mind to screenshot it, but it looked decent. Safari wasn’t launched at the time, but I received the push notification all the same. Looks like this is basically working!

[meta.discourse.org](http://meta.discourse.org) 现在支持 macOS Safari 推送。（希望苹果很快也会支持 iOS 网页推送。）

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2023年二月15日 23:04 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/25 "2023-02-15T23:04:59Z")

</div>

> [@dfabulich](#):
>
> [meta.discourse.org](http://meta.discourse.org) 现在支持 macOS Safari 推送。

一个小小的修正，_所有_最新的 Discourse 实例都支持 macOS Safari 的推送通知 😉

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年二月15日 23:10 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/26 "2023-02-15T23:10:57Z")

</div>

这有什么新意？我以为 MacOS Safari 一直支持通知？限制一直都是 iOS 的？

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2023年二月15日 23:17 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/27 "2023-02-15T23:17:02Z")

</div>

> [@merefield](#):
>
> 我以为 MacOS Safari 一直支持通知？

MacOS Safari 确实支持通知，但它们只是由页面 JavaScript 触发的。在 Discourse 中，这意味着您需要打开一个网站标签页，MessageBus 仍在轮询，标签页未被挂起等。

现在，Safari on MacOS 支持 WebPush 标准，即使没有打开 Safari，您仍然会收到通知，这非常类似于手机上的原生应用。

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年二月15日 23:18 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/28 "2023-02-15T23:18:22Z")

</div>

明白了，所以他们现在已经标准化了。这太棒了！谢谢你的解释。

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2023年二月16日 18:47 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/29 "2023-02-16T18:47:08Z")

</div>

> **[Web Push for Web Apps on iOS and iPadOS](https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/)**
>
> With iOS and iPadOS 16.4 beta 1 comes support for Web Push for Home Screen web apps, Badging API, Manifest ID, and more.

![Pushing Season 2 GIF by The Office](https://global.discourse-cdn.com/meta/original/4X/e/d/b/edbf1d47b1be068d7aa58d08a59c104b0cb0ea74.webp)

他们将其限制在添加到主屏幕的应用！我早在 2021 年就向 Chrome 团队提出了这个建议，作为遏制请求垃圾信息的一种方式，但他们驳回了。

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2023年二月16日 21:53 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/30 "2023-02-16T21:53:16Z")

</div>

![IMG_0099](https://global.discourse-cdn.com/meta/original/4X/6/7/e/67e8e4cff5e087bdd37983536c8163a7af99c3ba.jpeg)

 ![IMG_0101](https://global.discourse-cdn.com/meta/original/4X/5/c/d/5cd7e837d2274f40e0f82bca969d02ce970810df.jpeg)  
 ![IMG_0102](https://global.discourse-cdn.com/meta/original/4X/7/c/6/7c65ee6529764aeeccd7be8875203ee2ccdc3f6e.jpeg)

```plaintext
[1] pry(main)> PushSubscription.last
=> #<PushSubscription:0x00007fec11b781a8
   id: 5164,
   user_id: 8722,
   data:
    "{\"endpoint\":\"https://web.push.apple.com/.........\",\"keys\":{\"p256dh\":\"..................\",\"auth\":\"..............\"}}",
   created_at: Thu, 16 Feb 2023 21:51:24.260325000 UTC +00:00,
   updated_at: Thu, 16 Feb 2023 21:51:24.260325000 UTC +00:00,
   error_count: 0,
   first_error_at: nil>

```

Just enabled it here on Meta on my iPad, let’s see how it goes.

First iOS push notification prize goes to @maiki

 ![IMG_0103](https://global.discourse-cdn.com/meta/original/4X/9/6/6/96675597b482c9a2f845643f2d8e570d823fde03.jpeg)

Looooots of notifications

 ![IMG_0106](https://global.discourse-cdn.com/meta/original/4X/a/2/3/a2335cd2fc840db1ee198e37aaf32332d2b11b2c.jpeg)

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2023年二月17日 15:15 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/31 "2023-02-17T15:15:08Z")

</div>

这次我们可能会减少测试人员，至少一开始是这样：

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/d/3/fd344ca9b1d5b95704d0fa64bf43192490ca9bc4.jpeg)

如果使用配置文件安装 16.4，那么您将停留在 b1，除非您使用开发者账户登录或切换到公开测试版。

---

<div class="post-metadata">

**Author:** ![ClawdiaWolf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clawdiawolf/32/262518_2.png) [@ClawdiaWolf](https://meta.discourse.org/u/ClawdiaWolf)\
**Post date:** [2023年二月21日 20:56 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/34 "2023-02-21T20:56:13Z")

</div>

这些有什么问题吗？我在 Meta 上可以正常使用，但在我大多数自托管的实例以及 [https://forums.NaNoWriMo.org](https://forums.NaNoWriMo.org)（我是一名版主的企业托管客户）上却无法正常使用。

我无法正常使用的实例的共同点是，在通知偏好设置中缺少这个：

 ![IMG_1775](https://global.discourse-cdn.com/meta/original/4X/d/d/8/dd870ce78545f51975333973951de4c32b6b39bf.jpeg)

我已确认我的自托管实例启用了与正常工作的实例相同的通知设置，所以我很困惑，因为我真的很想在更多论坛上测试这个功能，尤其是 NaNo 论坛。

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2023年二月21日 21:47 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/35 "2023-02-21T21:47:42Z")

</div>

> [@ClawdiaWolf](#):
>
> 我无法正常工作的实例的共同点是，在通知偏好设置中缺少此项：

我们之前在 iOS 中手动阻止了推送通知，我刚刚在苹果发布支持推送的第一个开发者 beta 版的同一天（5 天前）将其移除。

自托管站点需要更新，而对于我们的托管服务，将在正常周期内推出，即在接下来的几天内。

---

<div class="post-metadata">

**Author:** ![ClawdiaWolf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clawdiawolf/32/262518_2.png) [@ClawdiaWolf](https://meta.discourse.org/u/ClawdiaWolf)\
**Post date:** [2023年二月21日 21:51 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/36 "2023-02-21T21:51:51Z")

</div>

> [@Falco](#):
>
> 自托管网站需要更新，而我们的托管将按正常节奏推出，即在几天内。

嗯，那这真的很奇怪。我所有的自托管实例昨天都更新了。除非安全更新需要更早进行，否则我总是在20号更新。我会再试着重建其中几个看看会发生什么。🙂

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2023年二月21日 21:58 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/37 "2023-02-21T21:58:42Z")

</div>

完整步骤如下：

1. 更新到 commit [FEATURE: Use feature detection for showing push notification in iOS (… · discourse/discourse@8a224bf · GitHub](https://github.com/discourse/discourse/commit/8a224bf99937d82e81fec2fb0b17adb428ee026e)

2. 更新到最新的 iOS 开发者测试版 16.4

3. 在 iOS Safari 高级设置中启用 Web 推送和通知

4. 将 Discourse 实例应用添加到主屏幕

5. 从新创建的主屏幕快捷方式启动

6. 登录，因为这些与 Safari 不共享 cookie

7. 在同意横幅或用户配置文件 \> 通知偏好设置页面中启用通知

---

<div class="post-metadata">

**Author:** ![ClawdiaWolf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/clawdiawolf/32/262518_2.png) [@ClawdiaWolf](https://meta.discourse.org/u/ClawdiaWolf)\
**Post date:** [2023年二月21日 22:13 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/38 "2023-02-21T22:13:16Z")

</div>

不确定哪里出了问题，但我刚刚重建的两个现在可以正常工作了。 🙂

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2023年二月21日 22:15 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/39 "2023-02-21T22:15:54Z")

</div>

> [@Falco](#):
>
> 更新到最新的 iOS 开发者测试版 16.4

现在有一个公开测试版。

---

<div class="post-metadata">

**Author:** ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)\
**Post date:** [2023年二月22日 00:17 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/40 "2023-02-22T00:17:01Z")

</div>

> [@Stephen](#):
>
> 如果您使用配置文件安装16.4，那么除非您使用开发者帐户登录或切换到公开测试版，否则您将停留在b1。

不完全准确。我下载了公开测试版配置文件，然后免费切换到了开发者测试版。

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2023年二月22日 00:19 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/41 "2023-02-22T00:19:38Z")

</div>

而且之前拥有开发者配置文件的任何人都可以升级到 16.4b1，后续升级似乎需要开发者访问权限。这不是我说的，以上语言来自苹果。

因此：

> [@Stephen](#):
>
> 如果使用配置文件安装 16.4，那么除非您使用开发者帐户登录或切换到公开测试版，否则您将停留在 b1。

---

<div class="post-metadata">

**Author:** ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)\
**Post date:** [2023年二月22日 02:00 UTC](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240/42 "2023-02-22T02:00:58Z")

</div>

有人猜测 iOS 16.4 何时会正式发布吗？

[上一頁](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240.md?page=1)

[下一頁](https://meta.discourse.org/t/ios-16-web-push-notifications-in-2023/229240.md?page=3)
