GCM and App Engine for chat application

耗尽温柔 提交于 2019-12-22 04:59:51

问题


I am planning to make a chat app through which user can send and receive text and media - audio, image and video. For simplicity I decided to use app engine with GCM. Doing downstream with GCM seems to be working well (for text messages) using the example guide provided and Android Studio template. When I tried upstream I did not receive the message back. May be this is very trivial but can someone please point me to a good tutorial or book on this. Any suggestions?

Used this for downstream: https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/GcmEndpoints And this for upstream: https://developers.google.com/cloud-messaging/upstream


回答1:


I had to add @ApiMethod(name = "sendMessage") to sendMessage method in MessagingEndpoint class generated through Studio template. After that I was able to use the sendMessage api to send the message back to app engine server which is linked to GCM and that message echoed back to my device as well.



来源:https://stackoverflow.com/questions/34127541/gcm-and-app-engine-for-chat-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!