Я использовал NotificationCompat для создания уведомлений. Это показало успешно, но без заголовка и содержания, хотя я настроил их
NotificationCompat
от androidx.core.app.NotificationCompat
override fun onMessageReceived(p0: RemoteMessage?) {
super.onMessageReceived(p0)
p0?.let {
it.notification?.let {
val alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
val builder = NotificationCompat.Builder(this as Context, "first")
.setContentTitle("My title")
.setContentText("My content")
.setSmallIcon(R.drawable.ebike_icon)
.setSound(alarmSound)
.setColor(Color.RED)
.setColorized(true)
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager)
.notify(1, builder.build())
}
}
}