2
我的Android版Chrome浏览器兼容标准版和开发者版(51)。尽管通知API在其他浏览器(Chrome桌面上的Firefox & + Android上的Firefox)上完美工作,但它在移动Chrome浏览器上不幸失败。浏览器要求获取通知事件的权限,但不会显示它。正如上面提到的那样,Firefox在同一个手机上没有问题,以及Chrome的桌面版本。这里是我的代码:适用于Android的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