• <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 中的函数

        时间:2023-08-02
          <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 中的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Firebase admin SDK FCM 错误 需要主题、令牌或条件之一 下一篇:Firebase FCM React 项目问题 - firebase-messaging-sw.js 类型错误?

                  相关文章

                  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'>

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