简体   繁体   English

android GCM迁移到Firebase

[英]android GCM migration to Firebase

I have just migrated my project that uses GCM to Firebase, by following this guide . 按照本指南 ,我已经将使用GCM的项目迁移到Firebase。 At the end of the migration guide it mentions that optionally one can replace the Google server endpoints with the ones from Firebase. 在迁移指南的最后,它提到可以选择用Firebase中的端点替换Google服务器端点。 However, when I try to send messages between devices, they are not delivered. 但是,当我尝试在设备之间发送消息时,它们没有被传递。

The only case that works is when I replace my old GOOGLE_API_KEY with the one I got from Firebase but with Google's endpoints! 唯一可行的情况是,我用从Firebase获得的旧GOOGLE_API_KEY替换了我的旧GOOGLE_API_KEY,但又将其替换为Google的端点!

From what I see in this link others also face similar issues. 根据我在此链接中看到的,其他人也面临类似的问题。 Has anyone any hint on this? 有人对此有任何暗示吗?

Well after searching a bit more, I saw that for sending messages via the FCM the server end point should be fcm.googleapis.com/fcm/send , ie append the /send. 在进行更多搜索之后,我看到用于通过FCM发送消息的服务器端点应该是fcm.googleapis.com/fcm/send ,即附加/ send。 This is a bit confusing, because in the migration guide the /send is not mentioned, whereas in this link and this SO solution it does. 这有点令人困惑,因为在迁移指南中未提及/ send,而在此链接此SO解决方案中却提到了。

Unless I am missing something, the migration guide should be updated. 除非我缺少任何内容,否则应该更新迁移指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM