是否需要 Firebase 云消息传递身份验证?

sor*_*vec 2 authentication jwt firebase firebase-authentication firebase-cloud-messaging

我在 php 中有自定义用户身份验证的服务器。我正在尝试与 Firebase 创建聊天,在阅读文档后,我仍然很困惑我需要为 Firebase 验证我的用户,如果是这样,我应该使用 signInWithCustomToken 吗?

欢迎任何有关我应该如何进行的其他提示。谢谢你。

Fra*_*len 6

无需验证用户即可接收FCM 消息。

但是,您确实需要传递 FCM 服务器密钥才能设备发送消息。您可以在Authorization此处的标题中看到一个示例:https : //firebase.google.com/docs/cloud-messaging/send-message

  • 听起来**你的应用**需要一种方法来识别用户。因此,虽然这不是 FCM 的要求,但您的应用程序可能需要它。无需用户签名即可识别用户身份的一种方法是 [使用 Firebase 的匿名身份验证](https://firebase.google.com/docs/auth/android/anonymous-auth)。但听起来您对这种类型的应用程序架构很陌生,因此我强烈建议您在继续之前使用 Firebase 代码实验室:https://firebase.google.com/docs/samples/#codelabs(搜索“ Codelabs”标题) (3认同)