I am trying to use GCM for android. After some steps that are provided by developer.google i got the registration id in toast, Now i want to store it in database. How to change here to store it in database. What steps i need to change for this updation???
code
mRegistrationBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// checking for type intent filter
if (intent.getAction().equals(config.REGISTRATION_COMPLETE)) {
// gcm successfully registered
// now subscribe to `global` topic to receive app wide notifications
String token = intent.getStringExtra("token");
Toast.makeText(getApplicationContext(), "GCM registration token: " + token, Toast.LENGTH_LONG).show();
} else if (intent.getAction().equals(config.SENT_TOKEN_TO_SERVER)) {
// gcm registration id is stored in our server's MySQL
Toast.makeText(getApplicationContext(), "GCM registration token is stored in server!", Toast.LENGTH_LONG).show();
} else if (intent.getAction().equals(config.PUSH_NOTIFICATION)) {
// new push notification is received
Toast.makeText(getApplicationContext(), "Push notification is received!", Toast.LENGTH_LONG).show();
}
}
};