gpt4 book ai didi

android - 有没有办法使用渐进式网络应用程序 (PWA) 添加徽章通知?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:07:06 25 4
gpt4 key购买 nike

我正在开发一个渐进式 Web 应用程序 (PWA),它最终会向用户发送通知。

我已经知道我能够发送推送通知(就像任何常规应用程序一样),如以下博客文章中所述:https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/?hl=en-us .

我也知道我可以通过创建一个简单的 list 文件 (https://developers.google.com/web/updates/2014/11/Support-for-installable-web-apps-with-webapp-manifest-in-chrome-38-for-Android) 将 PWA 添加到主屏幕。

但是,在主屏幕上显示该应用程序后,我想向用户添加一个“提示”,让他们知道他们必须访问该应用程序。一个很好的方法是执行类似“徽章通知”的操作(如下图的 Facebook 图标所示)。

Image showing a badge notification example on the Facebook icon

是否可以使用渐进式网络应用程序添加这种行为?


更新 - 2018 年 12 月 15 日

Google 最近发布了一篇文章,解释了所谓的“应用程序图标徽章”,这非常令人兴奋:

https://developers.google.com/web/updates/2018/12/badging-api

更新 - 2018 年 9 月 28 日

相关链接:

正如 Josh Lee 在 Is there a way to add badge notifications using progressive web apps (PWA)? 中指出的那样, 在 chromium 团队中有一些关于这个主题的讨论。

查看 discussion :

FYI, the notification indicators are being pushed to M-71.

Thanks for the heads up. That's fine for us because while we hope to have this testable behind a flag in M70, there's no way we'll be launching the API before (at least) M71.

因此,也许,至少目前,似乎无法为 PWA 添加徽章通知,但也许将来我们可以做到这一点。

最佳答案

以防万一有人来这里寻找答案

现在 chrome 和基于 chromium 的浏览器都支持它。这是了解更多的 imp 链接

关于android - 有没有办法使用渐进式网络应用程序 (PWA) 添加徽章通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45377604/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com