From the official documentation:
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
print('Got a message whilst in the foreground!');
print('Message data: ${message.data}');
if (message.notification != null) {
print('Message also contained a notification: ${message.notification}');
}
});
message.notification.android
also provides an AndroidNotification
object.
My question is, rather than creating various objects such as AndroidNotificationDetails
and NotificationDetails
to show a notification, can I simply pass this RemoteNotification
or AndroidNotification
and display it using flutter_local_notifications?