When the application is closed my Android doesn't receive push notifications from Firebase, but if I open the app, everything works. Here is my MainActivity:
package com.imperio.app
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
And my Flutter configure:
void configure() {
_firebaseMessaging.requestNotificationPermissions();
_firebaseMessaging.configure(
onLaunch: (params) {
_bloc.onEventChanged(DispatchLaunch(params));
return null;
},
onMessage: (params) {
_bloc.onEventChanged(DispatchMessage(params));
return null;
},
onResume: (params) {
_bloc.onEventChanged(DispatchLaunch(params));
return null;
}
);
}
When the application is open, I am receiving notifications normally. I see some people changing de MainActivity, but after embedded v2, Google documentation says nothing about it.
I added notification clicked in Android Manifest:
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
The problem is happening in Android 10, I tested in a Android 8 device and it works.