How can I use other plugins in workmanager with flutter?

47 Views Asked by At

I have an Android plugin in my Flutter project used to access the backend.

In my MainActivity.kt, I have :

override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
    GeneratedPluginRegistrant.registerWith(flutterEngine)
    flutterEngine.getPlugins().add(BackendChannelPlugin())
}

This works great, but when trying to use my plugin from an isolate spawned by workmanager, the plugin isn't registered (I get a Missing implementation error). How can I register my plugin in the Flutter Engine used by workmanager ? Every solution I've found on the internet has to do with the old PluginRegistrant callback implementation, which is now deprecated.

0

There are 0 best solutions below