I get the error "Cannot read property 'buffer' of undefined" if I call the method getToken()
, but only on my work notebook.
On my pesonal PC it is working.
Here is my code in the web app created via TypeScript:
this.messaging.requestPermission()
.then(() => {
console.log('Notification permission granted!');
return me.messaging.getToken(); ==> Here I get the error on my work notebook!
})
.then(messagingToken=> {
me.updateMessagingToken(messagingToken);
})
.catch((err) => {
console.log('Unable to get permission to notify.', err);
me.openSnackBar("Unable to get permission to notify!" + err);
})