简体   繁体   English

Firebase 令牌未在 flutter web 中生成

[英]Firebase token not generated in flutter web

Error:错误:

[firebase_messaging/token-subscribe-failed] Messaging: A problem occurred while subscribing the user to FCM: Request is missing required authentication credential. [firebase_messaging/token-subscribe-failed] 消息:为用户订阅 FCM 时出现问题:请求缺少所需的身份验证凭据。 Expected OAuth 2 access token, login cookie or other valid authentication credential.预期 OAuth 2 访问令牌、登录 cookie 或其他有效的身份验证凭据。 See https://developers.google.com/identity/sign-in/web/devconsole-project .请参阅https://developers.google.com/identity/sign-in/web/devconsole-project . .

at Object.createErrorWithStack (http://localhost:2277/dart_sdk.js:5080:12)在 Object.createErrorWithStack (http://localhost:2277/dart_sdk.js:5080:12)
at Function._throw (http://localhost:2277/dart_sdk.js:20337:18)在 Function._throw (http://localhost:2277/dart_sdk.js:20337:18)
at Function.throwWithStackTrace (http://localhost:2277/dart_sdk.js:20334:18)在 Function.throwWithStackTrace (http://localhost:2277/dart_sdk.js:20334:18)
at async._AsyncCallbackEntry.new.callback (http://localhost:2277/dart_sdk.js:40851:18)在 async._AsyncCallbackEntry.new.callback (http://localhost:2277/dart_sdk.js:40851:18)
at Object._microtaskLoop (http://localhost:2277/dart_sdk.js:40708:13)在 Object._microtaskLoop (http://localhost:2277/dart_sdk.js:40708:13)
at _startMicrotaskLoop (http://localhost:2277/dart_sdk.js:40714:13)在 _startMicrotaskLoop (http://localhost:2277/dart_sdk.js:40714:13)
at http://localhost:2277/dart_sdk.js:36191:9在 http://localhost:2277/dart_sdk.js:36191:9

You need to generate a Vapid Key in the Firebase Settings |您需要在 Firebase 设置中生成一个 Vapid Key | Cloud Messaging tab.云消息选项卡。

Please check the following answer on how to do that.请检查以下答案以了解如何执行此操作。

https://stackoverflow.com/a/54996207/10086962 https://stackoverflow.com/a/54996207/10086962

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM