2011-04-07 6 views
0

나는 동일한 Gmail ID를 사용하여 registration_idauthoCode을 얻었지만 여전히 "승인되지 않음"을 얻었습니다. 나는 지금 우둔한데 무엇이 잘못 될 수 있습니다.c2dm 용 Android 401

Android Cloud to Device Messaging에 가입하는 동안. 내가 [email protected]을 사용하고 있다면,이 AUTHCODE

을 얻는 동안 같은

Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER"); 
registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); 
registrationIntent.putExtra("sender", "[email protected]"); 
this.startService(registrationIntent); 

에 같은 [email protected]을 사용하고

https://www.google.com/accounts/ClientLogin?accountType=GOOGLE&[email protected]&Passwd=XXXXX&source=XXXXXXX-0.1&service=cl 

내가 사용하고 코드

$headers = array('Authorization: GoogleLogin auth=' . $authCode); 
$data = array(
    'registration_id' => $registrationId, 
    'collapse_key' => "test", 
    'data.message' => "wass up" //TODO Add more params with just simple data instead 
); 

print_r($headers); 
$ch = curl_init(); 

curl_setopt($ch, CURLOPT_URL, "https://android.apis.google.com/c2dm/send"); 
if ($headers) 
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 

$response = curl_exec($ch); 

curl_close($ch); 
echo($response); 
return $response; 
입니다

이있는 단계는 내가 새로운 GOOGL을 만들어

  1. 을 따라 내 응용 프로그램
  2. 에 대한 전자 계정은 내가,
  3. 는 AUTHCODE 및 RegistartionId을 받고 후 AUTHCODE
  4. 를 얻기 위해 같은 Gmail의 ID를 사용하여 등록 ID를 얻을 수있는 시뮬레이터에 http://code.google.com/android/c2dm/signup.html
  5. 처음으로 응용 프로그램을 그것을 실행 등록 메시지를 보내려고합니다.

단계가 누락 되었습니까?

답변