2

最近听说微软 Edge 移动版在 Windows 10 周年更新后支持 Web 通知。所以我尝试了以下代码,但它没有工作。

if ( window.Notification && Notification.permission !== "denied" ) {
    Notification.requestPermission( function( status ) { // status is "granted", if accepted by user
        var n = new Notification('Title', { 
            body: 'I am the body text!',
            icon: '/path/to/icon.png' // optional
        });
    });
}

我在使用 Edge 38.14393.67.0 和 EdgeHTML 14.14393 的 Windows 10 移动版上。

4

1 回答 1

0

我也尝试使用它,但我立即得到拒绝响应。我已经在反馈中心对此进行了处理。(更新)我在这里找到了他们的答案。https://github.com/MicrosoftEdge/MicrosoftEdge-Documentation/issues/62 所以是的,它会非常有限,但仍然如此。他们说支持。 https://developer.microsoft.com/en-us/microsoft-edge/platform/status/webnotifications/

于 2017-09-26T20:29:18.950 回答