I am creating a straight-forward foreground service with notification. The title is not showing even I am setting it with setContentTitle() function.
Here is my code for creating the channel:
private fun createNextPrayerNotificationChannel(): NotificationChannel {
return NotificationChannel(
Unique.NAME_NEXT_PRAYER_CHANNEL,
getString(R.string.next_prayer_channel),
NotificationManager.IMPORTANCE_HIGH
)
}
And here’s my code for creating notification:
return NotificationCompat.Builder(this, Unique.NAME_NEXT_PRAYER_CHANNEL)
.setOnlyAlertOnce(true)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setStyle(NotificationCompat.BigTextStyle())
.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(pendingIntent)
.setCustomContentView(contentView)
.setCustomBigContentView(contentView)
.build()
Where the content view is custom.