-
Notifications
You must be signed in to change notification settings - Fork 4k
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] Setup instructions #2895
Comments
I have run into same issue
According to documentations in V2 Embedding I shouldn't be registering plugins manually, but I can't get it to working that way. If I register it manually, then many other plugins start failing, because I have to register all of them manually, which defeats the purpose of having v2 in first place.
|
I agree readme and example needs update |
To add to this, this page: https://firebase.flutter.dev/docs/overview/ Still uses the method |
Could you just explain what docs should I use? |
@inpendio |
Very frustrating... :/ |
I am having the same issue |
Tem o codigo para .java? |
Hey all 👋 As part of our roadmap (#2582) we've just shipped a complete rework of the If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here. Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin. Thanks everyone. |
Describe the bug
Hi. First of all, sorry I won't be able to follow the template here, but I'm really confused. Today I tried using
firebase_messaging
to receive push notifications on Android. After following the current README instructions, I got this error:At this line:
GeneratedPluginRegistrant.registerWith(registry);
After googling for a while, I've found some issues related to this: flutter/flutter#45231, flutter/flutter#47095, #1613, #1684
From what I could understand, the instructions on the README file are for v1 embedding. It seems to me that the package has now implemented v2 embedding, based on the this guide: Supporting the new Android plugins APIs.
FlutterPlugin
andActivityAware
, while keeping a staticregisterWith()
method.io.flutter.embedding.android.FlutterActivity
and notio.flutter.app.FlutterActivity
.All this match the guide as a package that has been migrated to v2 but still aims compatibility with v1. The same guide above has this snippet:
So I expected that I could skip the setup instructions on README. Doing so raises the following error whenever a message is received:
There are also some issues on this: #248, #2017, #2077.
Long story short, the only solution that seems to work and that people keep posting over and over is this:
But I feel like most people including me don't understand what's going on. They just copy and paste it and it works. It's kind of a v1 registration on a v2 project.
I'm using firebase_messaging 6.0.16 and Flutter 1.17.5, and I do have the following on my manifest:
So here's my point:
GeneratedPluginRegistrant
class? TheFirebaseMessagingPlugin
is there, and it should work like every other plugin I'm using does.So either we need an updated README file with proper instructions or someone with a more advanced knowledge on this plugin should try to figure out what's going on. I'm sorry, but I'm relatively new to Flutter and for the moment this is the limit of my contribution.
Flutter doctor
Run
flutter doctor
and paste the output below:The text was updated successfully, but these errors were encountered: