Search code examples
angularjsgulpfirebase-cloud-messaging

Cannot read property 'getNotificationPermission_' of undefined


I'm using AngularJS with Gulp in my project. In localhost works fine, but when build it in production, it does not work and show the error below.

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

Solution

  • I just set the firebase to the last version and the problem was gone.