Click here to Skip to main content
15,940,921 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I want to implement push notification in my app. i followed up this link:
http://fryerblog.com/post/30057483199/implementing-push-notifications-with-gcm[^]
C#
private void RegisterWithGCM()
{
    GCMRegistrar.checkDevice(this);
    GCMRegistrar.checkManifest(this);
    final String regId = GCMRegistrar.getRegistrationId(this);
    if (regId.equals("")) {
      GCMRegistrar.register(this, SENDER_ID); // Note: get the sender id from configuration.
    } else {

      Log.v("Registration", "Already registered, regId: " + regId);
    }
}


With this i got the Registration ID(APA91bGAJrOxxxxxxxxxx). I struck up at this point meaning that with this Registration ID, how do i send notification to my android emulator.

Please can anyone suggest/guide me on this..

Thank you all.
Posted

1 solution

SQL
Check the sample gcm code found inside Android SDK installation. `gcm-demo-server` code will guide you on this.

You have to get the regID from your mobile and using `MessageBuilder` along with you message build the message and send.

For anymore help check the below link:-

http://developer.android.com/google/gcm/demo.html

&&

http://developer.android.com/reference/com/google/android/gcm/server/Message.Builder.html

All the best. :-)
 
Share this answer
 
Comments
Guru_C++ 29-Apr-13 1:59am    
yes.. It solved me.. Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900