I\'m new in flutter and dart. I\'m trying to connect my app with FCM. When app is in foreground I create flutterLocalNotificationsPlugin and everything works fine, but I don
The Dart VM does not run while the app is in background. That means you have to handle notifications and data messages in native code (Java/Kotlin/ObjectiveC/Swift).
To do this on Android, refer to the official documentation.
You will probably have to remove the firebase_messaging plugin and do all the message handling manually. To send the notification content to your flutter app (while it is in foreground), use platform channels.
It really helps to look at the source code of the firebase_messaging plugin to see what happens on the native side.