简体   繁体   English

FCM 错误:服务消息不可用

[英]FCM error: Service messaging is not available

import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
import { getMessaging } from "firebase/messaging";

// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey: "AIzaSyA0dAgRPZLlgULgnOp2MH_3xtVbWPs03Cg",
  authDomain: "u-63f99.firebaseapp.com",
  projectId: "u-63f99",
  storageBucket: "u-63f99.appspot.com",
  messagingSenderId: "884933400988",
  appId: "1:884933400988:web:0b7e0e37b0f23da236d059",
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
const fireStore = getFirestore(app);
const messaging = getMessaging(app);
export { auth, fireStore, messaging };

i'm getting this error, i don't know why messaging service is missing while i installed firebase SDK我收到此错误,我不知道为什么在安装 firebase SDK 时缺少消息服务

your problem is probably because you're testing this on localhost (http).您的问题可能是因为您正在本地主机(http)上测试它。

if you look at the console logs you might notice beside that error something like: code: 'messaging/unsupported-browser'如果您查看控制台日志,您可能会注意到该错误旁边的内容如下: code: 'messaging/unsupported-browser'

and cloud messaging only support https connections so you'd have to make your localhost run on https somehow to get it to work:)和云消息传递只支持 https 连接,所以你必须让你的本地主机在 https 上运行才能让它工作:)

暂无
暂无

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

相关问题 收到错误“FirebaseError:消息:我们无法注册默认服务工作者。” 使用 Sveltekit 设置消息传递 - Getting error "FirebaseError: Messaging: We are unable to register the default service worker." setting up messaging with Sveltekit 错误:消息:我们无法注册默认服务工作者 - Error: Messaging: We are unable to register the default service worker 检查 firebase 消息传递在浏览器中是否可用 - Check if firebase messaging is available in browser 使用 FCM(Firebase 云消息传递)通过 C# 将推送发送到 Android - Send push to Android by C# using FCM (Firebase Cloud Messaging) Firebase 云消息 (FCM) Api Azure 通知中心的密钥 - Firebase Cloud Messaging (FCM) Api Key for Azure Notification Hub FCM - “messaging/registration-token-not-registered” - 但客户端仍在使用令牌? - FCM - "messaging/registration-token-not-registered" - but the client is still using the token? 在 Kotlin 客户端应用程序中发送 FCM 推送通知 - Firebase 云消息传递 - Sending FCM Push Notification in Kotlin Client App - Firebase Cloud Messaging 请实施 -messaging:didReceiveRegistrationToken: 以提供 FCM 令牌。 颤振 - IOS - Please implement -messaging:didReceiveRegistrationToken: to be provided with an FCM token. FLUTTER - IOS 数量限制可以创建消息服务 - The number limit could be create of Messaging Service Firebase 消息传递错误:主题格式错误 - Firebase messaging error: Topic is malformed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM