GCM and App Engine for chat application

2019-04-26 14:27发布

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条回答
冷血范
2楼-- · 2019-04-26 14:53

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.

查看更多
登录 后发表回答