0

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);
})

enter image description here

4

1 回答 1

0

在我看来,您可能已经缓存了旧版本的应用程序。您是否尝试过 (1) 清除缓存,(2) 使用私有模式,(3) 使用其他浏览器?

于 2018-05-28T12:30:13.013 回答