Search code examples
phpandroidchatgoogle-cloud-messaginginstant-messaging

Google Cloud Messaging example


For a long time, I have been wanting to design a simple chat app based on Google Cloud Messaging. I know that the server supports a direct payload of 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? Or does mating GCM with Android API provide the necessary protocol of achieving this?

Can you please help me?

Thanks in advance


Solution

  • well you need one server not in php compulsory but in some other lang that gcm support like 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