When the app runs in background or app process is killed, the onMessageReceivedStream handler will not be called when receiving data messages.
Instead, you need to set up a background callback handler via the registerBackgroundMessageHandler method.
To set up a background handler, call registerBackgroundMessageHandler outside of your app logic as early as possible.
for example sample code :
package com.huawei.hms.flutter.push_example;
import com.huawei.hms.flutter.push.PushPlugin;
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class Application extends FlutterApplication implements PluginRegistry.PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
PushPlugin.setPluginRegistrant(this);
}
@Override
public void registerWith(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
}
also, double-check base integration steps in the link: