Closed posth2071 closed 1 month ago
From what I can see, the two examples you've given aren't a direct comparison as the one with this plugin only has a single message there. Have you checked the example app? If you still believe there's an issue and want to provide examples then please provide links to repositories hosting minimal apps where they try to reproduce the exact same scenario using native Android code vs this plugin
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
1) set shortcutId 2) 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
`
Flutter LocalNotification code
const shortcutId = 'shortcutId'; const person = Person( name: 'Person Name', icon: FlutterBitmapAssetAndroidIcon( 'assets/image/img_profile_placeholder.png'), );
return _flutterLocalNotifications.show( 0, title, body, NotificationDetails( android: AndroidNotificationDetails( _channel.id, _channel.name, channelDescription: _channel.description, importance: Importance.max, priority: Priority.high, icon: _androidIcon, enableLights: true, styleInformation: MessagingStyleInformation( person, conversationTitle: shortcutId, messages: [ Message( 'local Message Text', DateTime.now(), person, ), ], ), shortcutId: shortcutId, ), iOS: const DarwinNotificationDetails( presentAlert: true, presentSound: true, presentBadge: true, ), ), payload: payload != null ? jsonEncode(payload.toJson()) : null, ); `