Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private NotificationCompat.Builder createBaseNotification(Context context, PushData pushData, Bitmap largeIcon) throws Exception{
- NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
- .setContentTitle(TextUtils.isEmpty(pushData.title) ? notificationTitle : pushData.title)
- .setSubText(pushData.pushMessageSummary)
- .setContentText(pushData.pushMessageBody)
- .setSmallIcon(R.drawable.notification_icon)
- .setColor(context.getResources().getColor(R.color.colorPrimary))
- .setLights(0, 0, 0)
- .setAutoCancel(true)
- .setDefaults(Notification.DEFAULT_ALL);
- notificationBuilder.setContentIntent(getPendingIntent(context, pushData.pushDeeplink, pushData.pushId));
- if(largeIcon != null) {
- notificationBuilder.setLargeIcon(largeIcon);
- }
- return notificationBuilder;
- }
Add Comment
Please, Sign In to add comment