2012年6月27日 星期三

GCM (Google Cloud Messaging)

http://developer.android.com/guide/google/gcm/gs.html

Change from C2DM to GCM on 28 Jne 2012

According to the document, migration is simply change the email into API key.


Migration is simple! The only change required in the application is replacing the email account passed in the sender parameter of the registration intent with the project ID generated when signing up for the new service. For example:
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
// sets the app name in the intent
registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0));
registrationIntent.putExtra("sender", senderID);
startService(registrationIntent);

沒有留言:

張貼留言