I have written a test Flutter application in Android Studio to receive push notifications from Firebase. After finishing it, I installed it on a fresh Emulator through AVD and Tested out receiving a push notification while the app was terminated. That worked perfectly. While the app was open in the background. Once again succeeding. But strangely, while the app is opened, the push notification seems to be getting delivered to the device because I am getting D/FLTFireMsgReceiver( 6020): broadcast received for message after I publish the push notification but it never displays anything and I get
W/FirebaseMessaging( 6020): Unable to log event: analytics library is missing
W/FirebaseMessaging( 6020): Unable to log event: analytics library is missing
I've tried:
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
print('A new onMessage event was published!');})
and I don't even get the print line.
What could I be doing wrong that would cause the notifications to only work when the app isn't running in the foreground?