我有一个消息传递桌面应用程序,用Angular编写并用NWJS包装。 当应用程序在后台时,最终用户会收到HTML5通知。
在Mac上一切正常,但在Windows上,只有图标可以点击。如果用户点击标题或正文,则不会发生任何事情。
var options = {
dir: 'ltr',
body: 'Body Text',
icon: 'assets/images/desktop_notification.png'
}
var title = 'Title'
var notification = new Notification(title, options)
var notification.onclick = function() {
console.log('click event') // On windows, this will only fire if clicking on the icon
desktopNotificationOnClickEvent(title, body, chatID)
$timeout(
function()
notification.close()
, 7000
)
}
如何解决这个问题,以便通知上的每个地方都可以点击?