admin管理员组文章数量:1310297
Let say a user set permission to allow for receiving push notification but later changed those permissions to denied or default .
Is there some callback for this exposed in Serviceworker.
Let say a user set permission to allow for receiving push notification but later changed those permissions to denied or default .
Is there some callback for this exposed in Serviceworker.
Share Improve this question asked Aug 30, 2016 at 9:17 Prashant AgrawalPrashant Agrawal 67010 silver badges25 bronze badges1 Answer
Reset to default 13There's no event that's exposed to the service worker.
There's an event that you could listen for from the context of pages, via the Permissions API:
navigator.permissions.query({name: 'notifications'}).then(function(permission) {
// Initial status is available at permission.state
permission.onchange = function() {
// Whenever there's a change, updated status is available at this.state
};
});
本文标签: javascriptIs there any callback on permission change for web push notificationStack Overflow
版权声明:本文标题:javascript - Is there any callback on permission change for web push notification? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741828072a2399765.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论