Firebase消息传递/不匹配凭据(Firebase messaging/mismatched

系统教程 行业动态 更新时间:2024-06-14 16:55:57
Firebase消息传递/不匹配凭据(Firebase messaging/mismatched-credential)

我试图通过Firebase向特定设备发送通知,但遇到以下错误:

{“r”:{“results”:[{“error”:{“code”:“messaging / mismatched-credential”,“message”:“用于认证此SDK的凭证没有权限发送消息给“}}],”canonicalRegistrationTokenCount“:0,”failureCount“:1,”successCount“:0,”multicastId“:设备对应于提供的注册令牌,确保凭证和注册令牌都属于同一个Firebase项目。 5165415028752234000}}

我不确定是什么导致了这种情况,我正在使用与该项目关联的服务帐户和正确的设备ID。

任何帮助将是伟大的,谢谢!

I'm trying to send notifications to a specific device with Firebase but am getting the following error:

{"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}}

I'm not sure what is causing this, I'm using the service account associated with the project and the proper device id.

Any help would be great, thanks!

最满意答案

问题出在我的google-services.json 。 我的应用程序使用两个项目,并默认第一个项目。 添加第二个项目json文件最终解决了这个问题,因为它现在可以将令牌发送到适当的项目。

The issue was with my google-services.json. My app uses two projects and was defaulting to the first project. Adding the second project json file ended up fixing this since it can now send the tokens to the proper project.

更多推荐

本文发布于:2023-04-10 11:21:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/5ff9b960e958a515dc2d2c7490abf0d8.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:凭据   不匹配   消息   Firebase   messaging

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!