Source:
protected Notification makeNotificationSDK26OrHigher(Context context, PendingIntent intent, NotificationData notificationData) { NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); String channelId = "mp"; int importance = NotificationManager.IMPORTANCE_DEFAULT; ApplicationInfo applicationInfo = context.getApplicationInfo(); int stringId = applicationInfo.labelRes; String appName = stringId == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(stringId); NotificationChannel channel = new NotificationChannel(channelId, appName, importance); int notificationDefaults = MPConfig.getInstance(context).getNotificationDefaults(); if (notificationDefaults == Notification.DEFAULT_VIBRATE || notificationDefaults == Notification.DEFAULT_ALL) { channel.enableVibration(true); } if (notificationDefaults == Notification.DEFAULT_LIGHTS || notificationDefaults == Notification.DEFAULT_ALL) { channel.enableLights(true); channel.setLightColor(Color.WHITE); } mNotificationManager.createNotificationChannel(channel); final Notification.Builder builder = new Notification.Builder(context). setTicker(notificationData.message). setWhen(System.currentTimeMillis()). setContentTitle(notificationData.title). setContentText(notificationData.message). setContentIntent(intent). setStyle(new Notification.BigTextStyle().bigText(notificationData.message)). setChannelId(channelId); if (notificationData.whiteIcon != NotificationData.NOT_SET) { builder.setSmallIcon(notificationData.whiteIcon); } else { builder.setSmallIcon(notificationData.icon); } if (notificationData.largeIcon != NotificationData.NOT_SET) { builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), notificationData.largeIcon)); } if (notificationData.color != NotificationData.NOT_SET) { builder.setColor(notificationData.color); } final Notification n = builder.build(); n.flags |= Notification.FLAG_AUTO_CANCEL; return n; }

Target:
protected Notification makeNotificationSDK26OrHigher(Context context, PendingIntent intent, NotificationData notificationData) { NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); String channelId = MPConfig.getInstance(context).getNotificationChannelId(); String channelName = MPConfig.getInstance(context).getNotificationChannelName(); int importance = MPConfig.getInstance(context).getNotificationChannelImportance(); NotificationChannel channel = new NotificationChannel(channelId, channelName, importance); int notificationDefaults = MPConfig.getInstance(context).getNotificationDefaults(); if (notificationDefaults == Notification.DEFAULT_VIBRATE || notificationDefaults == Notification.DEFAULT_ALL) { channel.enableVibration(true); } if (notificationDefaults == Notification.DEFAULT_LIGHTS || notificationDefaults == Notification.DEFAULT_ALL) { channel.enableLights(true); channel.setLightColor(Color.WHITE); } mNotificationManager.createNotificationChannel(channel); final Notification.Builder builder = new Notification.Builder(context). setTicker(notificationData.message). setWhen(System.currentTimeMillis()). setContentTitle(notificationData.title). setContentText(notificationData.message). setContentIntent(intent). setStyle(new Notification.BigTextStyle().bigText(notificationData.message)). setChannelId(channelId); if (notificationData.whiteIcon != NotificationData.NOT_SET) { builder.setSmallIcon(notificationData.whiteIcon); } else { builder.setSmallIcon(notificationData.icon); } if (notificationData.largeIcon != NotificationData.NOT_SET) { builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), notificationData.largeIcon)); } if (notificationData.color != NotificationData.NOT_SET) { builder.setColor(notificationData.color); } final Notification n = builder.build(); n.flags |= Notification.FLAG_AUTO_CANCEL; return n; }