-
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] No documentation for Android v2 embedding backgroundMessage handler #1775
Comments
any solution for this error? |
same issue |
Solved it with following: import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
FlutterFirebaseMessagingService.setPluginRegistrant(this)
}
override fun registerWith(registry: PluginRegistry?) {
registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin");
}
} |
That would be better to get an official fix and not have to do a workaround with potential side effect |
I have another issue with the @gakubhat workaround (#116) Frustrating to have so many issues on a important plugin... |
@Ehesp hi, is there any ETA for solving this? |
This issue has been opened about half a year ago and still not under real investigation? C'mon guys, this is a real show stopper, especially for newbies that want to get into this stuff... Just set up a new, standard flutter project and follow the current documentation. It won't work... |
@ALL Sorry about the delay here, we are currently working on updating the messaging plugin, the documentation will be updated according to those final updates. We should have more on this very soon. |
É só você usar o PluginRegistry.PluginRegistrantCallback dessa forma: class FirebaseCloudMessagingPluginRegistrant {
companion object {
fun registerWith(registry: PluginRegistry) {
if (alreadyRegisteredWith(registry)) {
return;
}
FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"))
}
fun alreadyRegisteredWith(registry: PluginRegistry): Boolean {
val key = FirebaseCloudMessagingPluginRegistrant::class.java.name
if (registry.hasPlugin(key)) {
return true
}
registry.registrarFor(key)
return false
}
}
} class MainActivity : FlutterActivity(), PluginRegistry.PluginRegistrantCallback {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
FlutterFirebaseMessagingService.setPluginRegistrant(this)
}
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
override fun registerWith(registry: PluginRegistry?) {
registry?.let { FirebaseCloudMessagingPluginRegistrant.registerWith(it) }
}
} Funciona normalmente o "backgroundMessage handler" no meu projeto já modificado para embedding V2. |
I'm a bit confused about which plugins need to be manually registered in the Is it any plugin that we are using in the background, or is it plugins that haven't yet updated to the v2 embedding? |
Has this issue be resolved now, anybody knows? It is really important plugin for the Flutter framework. |
It will be resolved "very very soon", when version 8.0.0 will be released. |
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
Currently the documentation does NOT support the new Flutter Android v2 embedding that came along with flutter 1.12.13. The function
GeneratedPluginRegistrant.registerWith(registry);
no longer accepts aio.flutter.plugin.common.PluginRegistry
object, but aio.flutter.embedding.engine.FlutterEngine
object.Current code in documentation:
Newer code attempt with error:
To Reproduce
Steps to reproduce the behavior:
flutter create -a java example
The text was updated successfully, but these errors were encountered: