It's already resolved. To be able to see the heads-up notification:
for api < OREO :
you have set priority high to the builder and set the vibration:
NotificationCompat.Builder builder =
NotificationManager.getDefaultNotificationBuilder(context,
notificationMessage, NotificationManager.createDefaultNotificationChannel(context),R.drawable.ic_arrow)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setDefaults(Notification.DEFAULT_VIBRATE);
for API >= OREO :
you have to create a custom channel and pass it the priority, so that:
NotificationChannel notificationChannel = new NotificationChannel(channelId,
"Notifications", android.app.NotificationManager.IMPORTANCE_HIGH);