简体   繁体   English

Google Cloud Messaging示例

[英]Google Cloud Messaging example

For a long time, I have been wanting to design a simple chat app based on Google Cloud Messaging . 长期以来,我一直希望基于Google Cloud Messaging设计一个简单的聊天应用程序 I know that the server supports a direct payload of 4kB. 我知道服务器支持4kB的直接负载。

I just need to connect to specific phones through this app, just for a small project. 我只需要通过这个应用程序连接到特定的电话,仅用于一个小项目。

Do I need a seperate PHP server to help in this matter? 我是否需要单独的PHP服务器来帮助解决此问题? Or does mating GCM with Android API provide the necessary protocol of achieving this? 还是将GCM与Android API配合使用即可提供实现此目标的必要协议?

Can you please help me? 你能帮我么?

Thanks in advance 提前致谢

well you need one server not in php compulsory but in some other lang that gcm support like java 好,您需要一台不是php必修的服务器,而是在gcm支持的其他一些语言(如Java)中

its flow is some thing like 1 app get the registerid for gcm server 2 send that to your server where it store it 3 when you want to send a message to other app your send that message to your server 4 your server send a request with the target registeration id to gcm server 5 gcm send the message to the target app 它的流程类似于1个应用,获取gcm服务器的registerid 2将其发送到存储它的服务器3,当您想向其他应用发送消息时,将该消息发送到服务器4,服务器发送带有目标注册ID到gcm服务器5 gcm将消息发送到目标应用

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

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