Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase Messaging getToken()抛出:无法读取属性';缓冲区';未定义的_Firebase_Firebase Cloud Messaging - Fatal编程技术网

Firebase Messaging getToken()抛出:无法读取属性';缓冲区';未定义的

Firebase Messaging getToken()抛出:无法读取属性';缓冲区';未定义的,firebase,firebase-cloud-messaging,Firebase,Firebase Cloud Messaging,如果调用方法getToken(),但仅在我的工作笔记本上出现错误“无法读取未定义的属性“buffer”。 在我的个人电脑上,它正在工作 以下是我在通过TypeScript创建的web应用程序中的代码: this.messaging.requestPermission() .then(() => { console.log('Notification permission granted!'); return me.messaging.getToken(); ==> Here

如果调用方法
getToken()
,但仅在我的工作笔记本上出现错误“无法读取未定义的属性“buffer”。
在我的个人电脑上,它正在工作

以下是我在通过TypeScript创建的web应用程序中的代码:

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

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