You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted the push to show up like the default messenger and other chat apps, so while working on it I looked for the keyword android conversation shortcut and tried to incorporate it.
In the native android code, when you open a notification via NotificationManager, in order to display it in the conversation style, it only needs to meet two conditions to be displayed correctly
set shortcutId
Set MessagingStyle
However, when displaying a push via FlutterLocalNotifications plugin, it is displayed in normal push style even if you apply two conditions
The top notification in the attached photo shows the notification displayed via android native
The bottom notificationd is a notification displayed via FlutterLocalNotification
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
I'll attach my code
Android Native code
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val channelName = "Channel human readable title"
val channelDescription = "Channel human readable description"
val importance = NotificationManager.IMPORTANCE_DEFAULT
val channel = NotificationChannel(channelId, channelName, importance).apply {
description = channelDescription
}
notificationManager.createNotificationChannel(channel)
val notification = Notification.Builder(context, channelId)
.setStyle(
Notification.MessagingStyle(person)
.addMessage("message 1", System.currentTimeMillis(), person)
.addMessage("message 2", System.currentTimeMillis(), person)
.addMessage("message 3", System.currentTimeMillis(), person)
)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("ContentTitle")
.setContentText("ContentText")
.setAutoCancel(true)
.setSmallIcon(R.mipmap.ic_launcher)
.setShortcutId(shortcutId)
.setContentIntent(
PendingIntent.getActivity(
context,
0,
Intent(context, MainActivity::class.java),
PendingIntent.FLAG_IMMUTABLE
)
)
.build()
notificationManager.notify(1, notification)
I wanted the push to show up like the default messenger and other chat apps, so while working on it I looked for the keyword android conversation shortcut and tried to incorporate it.
In the native android code, when you open a notification via NotificationManager, in order to display it in the conversation style, it only needs to meet two conditions to be displayed correctly
However, when displaying a push via FlutterLocalNotifications plugin, it is displayed in normal push style even if you apply two conditions
The top notification in the attached photo shows the notification displayed via android native
The bottom notificationd is a notification displayed via FlutterLocalNotification
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
I'll attach my code
Android Native code
`
3. Flutter LocalNotification code
`
The text was updated successfully, but these errors were encountered: