Firebase云消息传递用令牌替换服务器密钥以发送通知/消息 [英] Firebase Cloud Messaging replaced the server keys with Tokens for sending notifications/messages

查看:118
本文介绍了Firebase云消息传递用令牌替换服务器密钥以发送通知/消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用Firebase Cloud Messaging的演示应用程序。但是,我正面临着Firebase服务器密钥的问题。今天早上我注意到我的服务器密钥被FCM令牌取代。

屏幕截图:



我是在两个Gmail帐户中有两个不同的FCM项目,这两个Gmail帐户具有相同的Android应用程序包名称。我认为这可能是造成问题,我已经删除了两个项目,并更改了包名称,但仍然没有运气。



我无法收到推送到我的设备。我已经研究过这个问题,但没有找到任何解决方案。我检查了Firebase发行说明,但不能发现任何解决方案。 解决方案

找到关于这个变化的任何推出。但是,看起来像服务器密钥很快就会被弃用,并将被FCM令牌取代。



如果您在使用服务器密钥时遇到问题,请考虑使用FCM令牌现在。






$ b $基本上,您只需要在发送消息到客户端应用程序时更改请求标头中的授权密钥的值。 b $ b

  Content-Type:application / json 
Authorization:key = XXXXXXXXX:APA91bHVdTcAQGdFc5bIyK_WExwd5U6uJ ....
pre>

I am developing a demo app using Firebase Cloud Messaging. However, I am facing issues with the Firebase server key. Today morning I noticed that my server key got replaced with the FCM tokens.

Screenshot :

I was having two different FCM projects in two Gmail accounts having same package name for the Android app. I thought this may be causing issue and I have deleted both the projects and changed the package name, but still no luck.

I am unable to receive the push to my device. I have researched about the issue but didn't find any solution.

解决方案

I checked the Firebase release notes, but can't find any roll out regarding this change. However, looks like the server key will be deprecated soon and will be replaced by the FCM token.

If you're having issues using the server key, then consider using the FCM token now.

Basically, you'll just need to change the value of the authorization key in the request header when sending messages to client apps.

Content-Type:application/json   
Authorization:key=XXXXXXXXX:APA91bHVdTcAQGdFc5bIyK_WExwd5U6uJ....

这篇关于Firebase云消息传递用令牌替换服务器密钥以发送通知/消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆