this should be the correct syntax of the application class
package YOUR.PACKAGE.NAME;
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;//<-- the correct import here
import io.flutter.embedding.engine.FlutterEngine;
public class Application extends FlutterApplication implements PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
FlutterFirebaseMessagingService.setPluginRegistrant(this);
}
@Override
public void registerWith(PluginRegistry registry) {
FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
}
}
Currently in readme.md, it has:
@Override
public void registerWith(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry);
}
@darshankawar
it's not working
the project is not even running
I just found the best solution
https://stackoverflow.com/a/60958130/6118808
Yes, you're absolutely correct. Today itself I was following those old dead steps as available on the package page and ended up with errors. The readme.md file is so outdated and even example app is so dead. Kindly, update it. It's so confusing for us, at least for me.
Most helpful comment
Yes, you're absolutely correct. Today itself I was following those old dead steps as available on the package page and ended up with errors. The
readme.mdfile is so outdated and evenexampleapp is so dead. Kindly, update it. It's so confusing for us, at least for me.