• <bdo id='duIny'></bdo><ul id='duIny'></ul>
  • <i id='duIny'><tr id='duIny'><dt id='duIny'><q id='duIny'><span id='duIny'><b id='duIny'><form id='duIny'><ins id='duIny'></ins><ul id='duIny'></ul><sub id='duIny'></sub></form><legend id='duIny'></legend><bdo id='duIny'><pre id='duIny'><center id='duIny'></center></pre></bdo></b><th id='duIny'></th></span></q></dt></tr></i><div id='duIny'><tfoot id='duIny'></tfoot><dl id='duIny'><fieldset id='duIny'></fieldset></dl></div>

    1. <legend id='duIny'><style id='duIny'><dir id='duIny'><q id='duIny'></q></dir></style></legend>

      <small id='duIny'></small><noframes id='duIny'>

    2. <tfoot id='duIny'></tfoot>

        TypeError:firebase.messaging 不是 node.js 中的函数

        TypeError: firebase.messaging is not a function in node.js(TypeError:firebase.messaging 不是 node.js 中的函数)
          <tbody id='JfTJ8'></tbody>

          <small id='JfTJ8'></small><noframes id='JfTJ8'>

          1. <i id='JfTJ8'><tr id='JfTJ8'><dt id='JfTJ8'><q id='JfTJ8'><span id='JfTJ8'><b id='JfTJ8'><form id='JfTJ8'><ins id='JfTJ8'></ins><ul id='JfTJ8'></ul><sub id='JfTJ8'></sub></form><legend id='JfTJ8'></legend><bdo id='JfTJ8'><pre id='JfTJ8'><center id='JfTJ8'></center></pre></bdo></b><th id='JfTJ8'></th></span></q></dt></tr></i><div id='JfTJ8'><tfoot id='JfTJ8'></tfoot><dl id='JfTJ8'><fieldset id='JfTJ8'></fieldset></dl></div>
          2. <tfoot id='JfTJ8'></tfoot>
            • <bdo id='JfTJ8'></bdo><ul id='JfTJ8'></ul>

                • <legend id='JfTJ8'><style id='JfTJ8'><dir id='JfTJ8'><q id='JfTJ8'></q></dir></style></legend>
                  本文介绍了TypeError:firebase.messaging 不是 node.js 中的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  尝试使用 firebase 模块在 node.js 中获取 FCM 消息时,出现以下错误TypeError: firebase.messaging is not a function".

                  While trying to fetch the FCM messages in node.js using firebase module, following error "TypeError: firebase.messaging is not a function" is occurring.

                  var firebase = require("firebase");
                  
                  firebase.initializeApp({
                      apiKey: "xxxxxxx",
                      authDomain: "xxxxxxx",
                      databaseURL: "xxxxxxx",
                      projectId: "xxxxxxx",
                      storageBucket: "xxxxxxx",
                      messagingSenderId: "xxxxxxx"
                  });
                  
                  const messaging = firebase.messaging();
                  

                  如何纠正这个错误以及如何使用firebase模块拉消息??

                  How to rectify this error and how to use firebase module to pull messages??

                  推荐答案

                  您尝试使用的条件仅适用于浏览器:

                  The criteria you are trying to use only works on the browser:

                  您必须要求 firebase-messaging,查看此完整示例,它将指导您 https://github.com/firebase/quickstart-js/tree/master/messaging

                  You have to require firebase-messaging, check this full sample it will guide you https://github.com/firebase/quickstart-js/tree/master/messaging

                  对于nodeJS的实现,你必须使用admin.messaging

                  For nodeJS implementation, you have to use admin.messaging

                  https://firebase.google.com/docs/reference/admin/node/admin.messaging

                  // Get the Messaging service for the default app
                  var defaultMessaging = admin.messaging();
                  

                  这篇关于TypeError:firebase.messaging 不是 node.js 中的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Status Code:200 OK (from ServiceWorker)quot; in Chrome Network DevTools?(“状态码:200 OK(来自 ServiceWorker)在 Chrome 网络开发工具中?)
                  How to set a header for a HTTP GET request, and trigger file download?(如何为 HTTP GET 请求设置标头并触发文件下载?)
                  Adding custom HTTP headers using JavaScript(使用 JavaScript 添加自定义 HTTP 标头)
                  SQL Query DocumentDB in Azure Functions by an integer not working(通过整数在 Azure Functions 中 SQL 查询 DocumentDB 不起作用)
                  Azure Functions [JavaScript / Node.js] - HTTP call, good practices(Azure Functions [JavaScript/Node.js] - HTTP 调用,良好实践)
                  Azure Functions - Import Custom Node Module(Azure Functions - 导入自定义节点模块)
                  1. <tfoot id='KhfiL'></tfoot>

                  2. <i id='KhfiL'><tr id='KhfiL'><dt id='KhfiL'><q id='KhfiL'><span id='KhfiL'><b id='KhfiL'><form id='KhfiL'><ins id='KhfiL'></ins><ul id='KhfiL'></ul><sub id='KhfiL'></sub></form><legend id='KhfiL'></legend><bdo id='KhfiL'><pre id='KhfiL'><center id='KhfiL'></center></pre></bdo></b><th id='KhfiL'></th></span></q></dt></tr></i><div id='KhfiL'><tfoot id='KhfiL'></tfoot><dl id='KhfiL'><fieldset id='KhfiL'></fieldset></dl></div>

                    <small id='KhfiL'></small><noframes id='KhfiL'>

                      <tbody id='KhfiL'></tbody>
                        <legend id='KhfiL'><style id='KhfiL'><dir id='KhfiL'><q id='KhfiL'></q></dir></style></legend>
                          <bdo id='KhfiL'></bdo><ul id='KhfiL'></ul>