Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_messaging] documentation need to be updated to import and parse the correct flutter engine class #3117

Closed
abdulmalekDery opened this issue Aug 7, 2020 · 3 comments · Fixed by #4012
Labels
plugin: messaging type: documentation Improvements or additions to documentation

Comments

@abdulmalekDery
Copy link

abdulmalekDery commented Aug 7, 2020

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"));
}
}

@abdulmalekDery abdulmalekDery changed the title your documentation need to be updated to import and parse the correct flutter engine class [firebase_messaging] your documentation need to be updated to import and parse the correct flutter engine class Aug 7, 2020
@darshankawar
Copy link

Currently in readme.md, it has:

@Override
  public void registerWith(PluginRegistry registry) {
    GeneratedPluginRegistrant.registerWith(registry);
  }

@darshankawar darshankawar added plugin: messaging type: documentation Improvements or additions to documentation labels Aug 7, 2020
@abdulmalekDery
Copy link
Author

@darshankawar
it's not working
the project is not even running
I just found the best solution
https://stackoverflow.com/a/60958130/6118808

@TahaTesser TahaTesser changed the title [firebase_messaging] your documentation need to be updated to import and parse the correct flutter engine class [firebase_messaging] documentation need to be updated to import and parse the correct flutter engine class Aug 7, 2020
@omishah
Copy link

omishah commented Aug 9, 2020

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.

@firebase firebase locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin: messaging type: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants