0

Below is the how to from google to register for GCM. Where in the second line of code do I put my appid? Comme to think about it is the appid the name of my project on the Google App Engine?

sender is the ID of the account authorized to send messages to the application, typically the email address of an account set up by the application's developer. app is the application's ID, set with a PendingIntent to allow the registration service to extract application information. For example:

Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); // boilerplate
registrationIntent.putExtra("sender", "someemail@oo.com");
startService(registrationIntent);
Eran
  • 387,369
  • 54
  • 702
  • 768
user1840829
  • 61
  • 1
  • 6

2 Answers2

1

The code in your quote is partly wrong. The value of sender used to be an email address (in the now deprecated C2DM), but in GCM the sender should contain the Google API Project ID.

sender is the project number of the account authorized to send messages to the Android application.

app is the Android application's ID, set with a PendingIntent to allow the registration service to extract Android application information.

Community
  • 1
  • 1
Eran
  • 387,369
  • 54
  • 702
  • 768
0

According to http://developer.android.com/google/gcm/gcm.html

app is the Android application's ID, set with a PendingIntent to allow the registration service to extract Android application information.

GCM extracts your app ID from the pending intent you are passing. So your second line is as it should be.

But I recommend you to use the gcm.jar library instead. It makes handling GCM much easier: Add gcm.jar in Eclipse IDE (Google Cloud Messaging)

Community
  • 1
  • 1
Jorge Cevallos
  • 3,667
  • 3
  • 25
  • 37