Chrome Android - 通知不显示

Chrome for Android - Notifications don't appear

对于 Android 标准版和开发版 (51),我在 Chrome 方面遇到了问题。虽然通知 api 在其他浏览器(Chrome 和桌面版 Firefox + Firefox Android 上完美运行,但不幸的是它在移动设备上失败 chrome。浏览器请求通知事件的权限,但不显示它。正如上面提到的 Firefox 一样 phone 没有问题,桌面版 Chrome 也是如此。这是我的代码:

handleNotification: function (message) {
    if (!Notification) { return; }
    if (Notification.permission !== "granted") { Notification.requestPermission(); }
    else {
        var notification = new Notification(participantsRepository[message.senderID].firstName, {
            icon: participantsRepository[message.senderID].photo,
            body: message.body,
        });
        notification.onclick = function () {
            this.props.updateViewOnMessengerComponent('threadView');
            this.updateCurrentThread(message.thread, true);
        }.bind(this);
    }
},

有什么解决办法吗?
干杯,Wojtek

我在 Twitter 上询问了 Alex Russel 关于这个问题,结果发现我在我的应用程序中使用的遗留通知 API 目前在 chrome。看来我必须使用 Google 的官方推送通知 API,尤其是 android 用户。