I am using push notification service of Parse.com. According to the doc:
override onPushReceive to trigger a background operation for \"silent\" pus
You can use the intent extra parameter "action" to call your intent to handle whatever you want.
Original onPushReceive source:
protected void onPushReceive(Context context, Intent intent) {
JSONObject pushData = null;
try {
pushData = new JSONObject(intent.getStringExtra("com.parse.Data"));
} catch (JSONException var7) {
Parse.logE("com.parse.ParsePushReceiver", "Unexpected JSONException when receiving push data: ", var7);
}
String action = null;
if(pushData != null) {
action = pushData.optString("action", (String)null);
}
if(action != null) {
Bundle notification = intent.getExtras();
Intent broadcastIntent = new Intent();
broadcastIntent.putExtras(notification);
broadcastIntent.setAction(action);
broadcastIntent.setPackage(context.getPackageName());
context.sendBroadcast(broadcastIntent);
}
Notification notification1 = this.getNotification(context, intent);
if(notification1 != null) {
ParseNotificationManager.getInstance().showNotification(context, notification1);
}
}
And no notification if no "alert" or "title" extra in the intent.
So you do not need to extend any class at all for silent push updates...