0

I trying to register c2dm, but allways give me this error:

05-18 10:48:32.357: D/C2DMRegistrar(225): [C2DMRegistrar.46] register: http error 400

this is the register method:

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);
}

I test it with GSF_PACKAGE, and without GSF_PACKAGE.

SenderId is a mail acount XXXX@XXX.com, and I received a mail like this:

From: noreply@google.com [mailto:noreply@google.com] 

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:

 XXXX@XXX.com

I´m in AVD emulator, and i have a google account in emulator too. And in real mobile, same thing.

I don´t receive any call in C2DMBaseReceiver.onHandleIntent, only show that error.

Any idea?

Mat
  • 202,337
  • 40
  • 393
  • 406

1 Answers1

0

Have you set Your Google account through your Emulator, if not do so by Settings-> Account& Sync-> Add an account Hope this helps !!!

g90uagk
  • 420
  • 2
  • 5
  • 16