Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCM and App Engine for chat application

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

like image 917
user531069 Avatar asked Dec 07 '15 06:12

user531069


1 Answers

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.

like image 85
user531069 Avatar answered Oct 19 '22 14:10

user531069