我正在开发一个渐进式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图标中显示)。
android - 有没有一种使用渐进式Web应用程序(PWA)添加徽章通知的方法?-LMLPHP
是否可以使用渐进式Web应用程序添加这种行为?

更新-2018年12月15日
Google最近发布了一篇帖子,解释了所谓的“Badging for App Icons”,这很令人兴奋:
https://developers.google.com/web/updates/2018/12/badging-api
更新-2018年9月28日
相关链接:

  • https://bugs.chromium.org/p/chromium/issues/detail?id=719176&desc=2
  • https://bugs.chromium.org/p/chromium/issues/detail?id=685159
  • https://github.com/mgiuca/badging/blob/master/explainer.md
  • https://docs.google.com/document/d/1AmX53h-gk8wN7LPMi_Mq7fsIMgsMKRD6zKa1Ymxxvvc/edit#

  • 正如Josh Lee在Is there a way to add badge notifications using progressive web apps (PWA)?中指出的那样, Chrome 团队对此主题进行了一些讨论。
    discussion:



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

    最佳答案

    更新2020年: check this SO answer for latest information:

    原始答案:
    看起来这是在路线图上,可能在M71的标志后面。
    crbug.com/719176
    crbug.com/685159
    (因此,十月下旬的beta版(schedule)。此错误上没有其他 Activity 可以证实这一点,但是大多数WebAPK工作都不是针对公共(public)错误,FWIW。)

    10-04 23:00
    查看更多