Google AuthToken Validity for C2DM Services

716 views Asked by At

I am Developing a web server which sends push messages automatically to my android application whenever I add new data on web server. But, for sending the push message through C2DM server we need to get a google Authentication Token(AuthToken). My doubt is that whether the token can be saved and used for later times also, or we should every time get a fresh AuthToken...!!!

Someone please help me regarding this..!

Thanks in Advance

1

There are 1 answers

0
Alig On

As far as I know, Google did not state how long the Authentication Token will be valid. But when sending out a push notification to the C2DM server, the response may include a Update-Client-Auth, where also a new AuthToken is included.

So basically you can store the AuthToken and reuse it, just make sure that you handle the response, and of course, if you receive a 401 Code as response, you have to manually request a new Auth Token.

See also:

C2DM Sending Messages

Google C2DM