PushSharp - GCM 授权失败

PushSharp - GCM Authorization Failed

使用 Pushsharp v4.0.10(nuget 包),向 Android 设备发送推送通知时出现错误 GCM Authorization Failed

似乎问题 574 (https://github.com/Redth/PushSharp/issues/574 ) 中提出的错误已编译到 nuget 包中,但我仍然收到此错误。

这是否与 Firebase 云消息传递的引入有关?

还有人成功使用 GCM 吗?

截至目前,GCM 仍然可用。但是,强烈建议新用户改用 FCM。无论哪种方式,对于 GCM 和 FCM,您都必须使用从 Firebase 控制台生成的服务器密钥。 GCM docs 中有一个可见的注释:

Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.

许多用户遇到了授权错误,有些用户还有一个旧项目。有关更多详细信息,请参阅我的回答 here

应用代码中使用的发件人id需要匹配发件人id Firebase Cloud Message Console及其对应的"Firebase Cloud Messaging token".

感谢@AL 的帮助。