firebaseモジュールを使用してnode.jsでFCMメッセージをフェッチしようとしているときに、エラー "TypeError:firebase.messaging is not function"が発生しています。TypeError:firebase.messagingがnode.jsの関数ではありません
var firebase = require("firebase");
firebase.initializeApp({
apiKey: "xxxxxxx",
authDomain: "xxxxxxx",
databaseURL: "xxxxxxx",
projectId: "xxxxxxx",
storageBucket: "xxxxxxx",
messagingSenderId: "xxxxxxx"
});
const messaging = firebase.messaging();
このエラーを修正する方法とfirebaseモジュールを使用してメッセージをプルする方法はありますか?
私の考えは、ブラウザの操作なしにfcmから通知を受け取るノードアプリケーションを作成することです。私はこれらのメソッド 'var firebase = require(" firebase/messaging ");を試していましたが、これは動作しません。 –
@vishnumohan_t私は答えを更新しました – Bamieh