开发者

Who provides AUTH token to use with C2DM?

开发者 https://www.devze.com 2023-01-24 14:05 出处:网络
I\'m developping some kind of IM application for iPhone/WP7/Android. After reading documentation I\'m not sure, that understand right what credentials I must use, to authentificate my 开发者_运维技巧

I'm developping some kind of IM application for iPhone/WP7/Android.

After reading documentation I'm not sure, that understand right what credentials I must use, to authentificate my 开发者_运维技巧backend on ac2dm service. In chrometophone server uses user's auth token, but my client's application is not linked with google at all. Should I create Activity, that asks user to enter their google accound credentials, or I can use my own account to send notifications to c2dm?


The sender id is not the "real" user (that gets notified), but an account authorizing your web application for using c2dm. It is the role based account specified on the c2dm signup page.

The authToken has to be generated with ClientLogin, for example:

curl https://www.google.com/accounts/ClientLogin       \ 
   -d Email=my-app@gmail.com -d Passwd=my-pass         \
   -d accountType=HOSTED_OR_GOOGLE                     \
   -d source=companyName-applicationName-version       \
   -d service=ac2dm

See also - ClientLogin request. If the account has 2-step verification enabled, the password must be application-specific. See also this question.


use the google account you setup as the role account for c2dm

This link from the internets looks pretty good for explaining the process. I'm in the process of getting it to work but everything the guy said made sense to me, I had the same confusion as you before I read it (search page for "Gary is correct"):

http://groups.google.com/group/android-c2dm/browse_thread/thread/3370e6fa9b90542b/d889956c87035bd3

0

精彩评论

暂无评论...
验证码 换一张
取 消