2012-05-18 33 views
0

我嘗試註冊C2DM,但永諾給我這個錯誤:C2DM配準誤差

10月5日至一十八日:48:32.357:d/C2DMRegistrar(225):[C2DMRegistrar.46]寄存器:http錯誤400

這是寄存器方法:

public static final String EXTRA_SENDER = "sender"; 
public static final String EXTRA_APPLICATION_PENDING_INTENT = "app"; 
public static final String REQUEST_UNREGISTRATION_INTENT = "com.google.android.c2dm.intent.UNREGISTER"; 
public static final String REQUEST_REGISTRATION_INTENT = "com.google.android.c2dm.intent.REGISTER"; 
public static final String LAST_REGISTRATION_CHANGE = "last_registration_change"; 
public static final String BACKOFF = "backoff"; 
// public static final String GSF_PACKAGE = "com.google.android.gsf"; 

public static void register(Context context, String senderId) { 
Intent registrationIntent = new Intent(REQUEST_REGISTRATION_INTENT); 
// registrationIntent.setPackage(GSF_PACKAGE); 
registrationIntent.putExtra(EXTRA_APPLICATION_PENDING_INTENT, 
    PendingIntent.getBroadcast(context, 0, new Intent(), 0)); 
registrationIntent.putExtra(EXTRA_SENDER, senderId); 
context.startService(registrationIntent); 
} 

GSF_PACKAGE測試它,並且不GSF_PACKAGE

SenderId是一個郵件acount [email protected],我收到一個郵件是這樣的:

From: [email protected] [mailto:[email protected]] 

Thank you for your interest in Android Cloud to Device Messaging (C2DM). 
We've accepted your application into the trial group. The Google account 
you requested as the sender account for your application: 

[email protected] 

I'm在AVD模擬器,和我有一個谷歌帳戶的模擬器了。在真正的移動設備中,同樣的事情。

我沒有收到C2DMBaseReceiver.onHandleIntent的任何電話,只顯示該錯誤。

有什麼想法?

回答

0

你是否已經通過你的模擬器設置了你的谷歌賬戶,如果不是這樣,通過設置 - >賬戶& Sync->添加一個賬戶 希望這有助於!

+0

它已經準備就緒。 我在AVD模擬器,我也有一個谷歌帳戶在模擬器中。在真正的移動設備中,同樣的事情。 –