首页 > 解决方案 > 无法读取未定义的属性“getNotificationPermission_”

问题描述

我在我的项目中使用 AngularJS 和 Gulp。在 localhost 中工作正常,但是在生产中构建它时,它不起作用并显示下面的错误。

Unable to get permission to notify. TypeError: Cannot read property 'getNotificationPermission_' of undefined
    at vendor.js:100634
    at vendor.js:100634
    at Object.next (vendor.js:100634)
    at vendor.js:100634
    at new Promise (<anonymous>)
    at n (vendor.js:100634)
    at a.requestPermission (vendor.js:100634)
    at vendor.js:100666

标签: angularjsgulpfirebase-cloud-messaging

解决方案


我只是将firebase设置为最后一个版本,问题就消失了。


推荐阅读