Source:
protected void onPushReceive(android.content.Context context, android.content.Intent intent) { try { String action = intent.getAction(); String channel = intent.getExtras().getString("com.parse.Channel"); String payloadStr = intent.getExtras().getString("com.parse.Data"); logger.debug("channel ----- " + channel + " payload = " + payloadStr); Gson gson = new GsonBuilder().create(); NotificationPayload payload = gson.fromJson(payloadStr, NotificationPayload.class); if ( payload.isValid() ){ String titleTemplateName = payload.getTitleLocKey(); String titleTemplate = ""; if ( titleTemplateName != null) { titleTemplate = ResourceUtil.getResourceString(titleTemplateName); payload.setTitle(titleTemplate); } List<String> args = payload.getLocArgs(); if ( args != null && args.size() > 0 ){ String alert = args.get(0); payload.setAlert(alert); Bundle courseBundle = new Bundle(); courseBundle.putBoolean(Router.EXTRA_ANNOUNCEMENTS, true); courseBundle.putString(Router.EXTRA_COURSE_ID, payload.getCourseId()); Intent resultIntent = new Intent(context, CourseDetailTabActivity.class); resultIntent.putExtra( Router.EXTRA_BUNDLE, courseBundle); PendingIntent resultPendingIntent = PendingIntent.getActivity( context, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT ); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setContentTitle(payload.getTitle()); builder.setContentText(payload.getAlert()); builder.setSmallIcon(R.drawable.app_icon); builder.setContentIntent(resultPendingIntent); builder.setAutoCancel(true); Uri uri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); builder.setSound(uri); int mNotificationId = 001; notificationManager.notify(mNotificationId, builder.build()); return; } } } catch (Exception e) { super.onPushReceive(context, intent); } super.onPushReceive(context, intent); }

Target:
protected void onPushReceive(android.content.Context context, android.content.Intent intent) { try { String action = intent.getAction(); String channel = intent.getExtras().getString("com.parse.Channel"); String payloadStr = intent.getExtras().getString("com.parse.Data"); logger.debug("channel ----- " + channel + " payload = " + payloadStr); Gson gson = new GsonBuilder().create(); CourseUpdateNotificationPayload payload = gson.fromJson(payloadStr, CourseUpdateNotificationPayload.class); if ( payload.isValid() ){ String titleTemplateName = payload.getTitleLocKey(); String titleTemplate = ""; if ( titleTemplateName != null) { titleTemplate = ResourceUtil.getResourceString(titleTemplateName); payload.setTitle(titleTemplate); } List<String> args = payload.getLocArgs(); if ( args != null && args.size() > 0 ){ String alert = args.get(0); payload.setAlert(alert); Bundle courseBundle = new Bundle(); courseBundle.putBoolean(Router.EXTRA_ANNOUNCEMENTS, true); courseBundle.putString(Router.EXTRA_COURSE_ID, payload.getCourseId()); Intent resultIntent = new Intent(context, CourseDetailTabActivity.class); resultIntent.putExtra( Router.EXTRA_BUNDLE, courseBundle); PendingIntent resultPendingIntent = PendingIntent.getActivity( context, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT ); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setContentTitle(payload.getTitle()); builder.setContentText(payload.getAlert()); builder.setSmallIcon(R.drawable.app_icon); builder.setContentIntent(resultPendingIntent); builder.setAutoCancel(true); Uri uri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); builder.setSound(uri); int mNotificationId = RemoteNotificationTypes.COURSE_ANNOUNCEMENT.ordinal(); notificationManager.notify(mNotificationId, builder.build()); return; } } } catch (Exception e) { super.onPushReceive(context, intent); } super.onPushReceive(context, intent); }