public class GCMIntentService extends GCMBaseIntentService {
NotificationManager mNotificationManager;
Context cc;
@Override
protected void onRegistered(Context context, String regId) {
Intent intent = new Intent(Constants1.ACTION_ON_REGISTERED);
intent.putExtra(Constants1.FIELD_REGISTRATION_ID, regId);
context.sendBroadcast(intent);
}
@Override
protected void onUnregistered(Context context, String regId) {
Log.i(Constants1.TAG, "onUnregistered: " + regId);
AlertDialog.Builder alert = new AlertDialog.Builder(
getApplicationContext());
alert.show();
}
@Override
protected void onMessage(Context context, Intent intent) {
/**
* You can get the Extras from TaxMann server
*
* Bundle _bundle = intent.getExtras();
*/
String msg = intent.getStringExtra("payload");
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
BackgroundAlert bg = new BackgroundAlert(mNotificationManager, msg);
bg.onReceive(getApplicationContext(), intent);
}
@Override
protected void onError(Context context, String errorId) {
}
}
This is my code for gcm i have approx 15000 registered_device_id in my database for notification when i send notification to all register device id then it show 10000 success and 6000 unsuccessful .i want to delete all 6000 registered device id from our database so that it take less time to get notification .