Search code examples
phpjqueryasp.netandroid-c2dm

C2DM Application Server solution


Can anyone recommend a tutorial or point me in the direction of some easily implemented .net or PHP code that i could use to setup a third party application server for C2DM.

I am a Front-End Developer with some PHP/.net experience, but very minimal Java experience, our app is setup with the required java code/classes and I have registered with C2DM, but i'm struggling with the application server part of the equation.

I would like to setup a server application that can handle form requests to send a message out to our app.

Any help or advice would be greatly appreciated!


Solution

  • The server part of C2DM is a piece of cake compare to the client (in my opinion). You can find below some tutorials about the server part :

    One for JAVA very easy to understand even if your are not JAVA developper.
    One for PHP and Zend framework.
    A basic example for C# on stackoverflow

    A common mistake to avoid if you want some performance : Don't connect for each message to send. You just have to auth one time to the google server and then you can send multiple notification message.

    Also don't forget that Google will periodically refresh the token in an Update-Client-Auth header. You should handle this header to keep your tokens up to date. Have look to this discussion about it