我正在概述我在应用程序中实施 C2DM 的计划,并且有一个关于 Auth 令牌的基本(阅读:愚蠢)问题。
客户端服务器需要使用白名单账户注册 google c2dm 服务:
供测试用:
curl https://www.google.com/accounts/ClientLogin -d Email=theEmailYouWhitelisted -d Passwd=pass****word -d accountType=HOSTED_OR_GOOGLE -d source="your_app_name_and_ver_for_logging_purposes_only" -d service=ac2dm
我的问题是,每个应用程序每个 c2dm 帐户是否会发生一次 - 即:使用您的白名单帐户获取一个服务器生成的身份验证代码,存储它,然后每次发送消息时检索它并使用:
curl --header "Authorization: GoogleLogin auth=**authFromRegistrationAbove**" "https://android.apis.google.com/c2dm/send" -d registration_id=**phoneRegistrationId(reciever)** -d "data.message=StringToPass" -d collapse_key=something -k
或者您是否必须为每条推送的消息请求一个新的验证码?