flutter_workmanager
flutter_workmanager copied to clipboard
Is it possible to call native android code via method chanels inside the callbackDispatcher ?
I'm trying to call android method via platform chanels. They work fine when called from main isolate but when calling from my callbackDispatcher I always get "Error in background task: MissingPluginException(No implementation found for method ... my android method)"
Is it intended to work or not in the first place ? Can't find doc about this Thanks for any clues !
any updates?
I would also be very interested in the answer.
@tempo-riz I faced the same issue, and the only workaround that worked for me was extracting the native methods into an independent Flutter plugin. This ensures proper initialization in the background isolate.
Could you share some code?
I believe this issue persists. I get the exact same error:
MissingPluginException(No implementation found for method ... )
@ghassenbenzahra123 I'll try your solution, thanks.
Well, I got it to work with the independent Flutter plugin. I created it inside the same project, which ultimately worked, but it is basically impossible to debug the code, because I didn't have any lint or checks for errors. The errors just appeared when I ran the project. Is there a better way to implement this plugin?