you have to make change in the notification display section .
here a sample of code which i used
private Notification createNotification(String msg, PendingIntent notificationPendingIntent) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
String CHANNEL_ID = "notification_chanel";// The id of the channel.
CharSequence name = "App name";// The user-visible name of the channel.
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name, importance);
Notification notification = new Notification.Builder(this)
.setSmallIcon(R.drawable.logo_notext)
.setContentTitle("Geofence Notification!")
.setContentText(msg)
.setAutoCancel(true)
.setChannelId(CHANNEL_ID)
.setContentIntent(notificationPendingIntent).build();
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.createNotificationChannel(mChannel);
return notification;
} else {
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);
notificationBuilder
.setSmallIcon(R.drawable.logo_notext)
.setColor(Color.RED)
.setContentTitle(msg)
.setContentText("Geofence Notification!")
.setContentIntent(notificationPendingIntent)
.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND)
.setAutoCancel(true);
return notificationBuilder.build();
}
}
Hope it helps you