gpt4 book ai didi

Firebase 消息传递/凭据不匹配

转载 作者:行者123 更新时间:2023-12-02 15:08:11 27 4
gpt4 key购买 nike

我尝试使用 Firebase 向特定设备发送通知,但收到以下错误:

{"r": {"results":[{"error":{"code":"messaging/mismatched-credential","message":"The credential used to authenticate this SDK does not have permission to send messages to the device corresponding to the provided registration token. Make sure the credential and registration token both belong to the same Firebase project."}}],"canonicalRegistrationTokenCount":0,"failureCount":1,"successCount":0,"multicastId":5165415028752234000}}

我不确定是什么原因造成的,我正在使用与项目关联的服务帐户和正确的设备 ID。

任何帮助都会很棒,谢谢!

最佳答案

此错误消息可以在 documentation for FCM 中找到.

这意味着您已使用与设备注册 token 不同的项目凭据初始化了 Admin SDK。

换句话说:出于安全原因,您不能简单地将消息发送到您提出的任何设备 token 。您只能通过同一项目中的应用向设备 token 发送消息。

关于Firebase 消息传递/凭据不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48712698/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com