0

I am using the WorkManager package to run background tasks, but from my understanding this should apply to any kind of background work when the app is closed. If I try to call some native code using the methodChannel it doesn't work, because the flutter engine is not active as the app is closed. Instead, as also found out by this guy "https://stackoverflow.com/questions/69391772/flutter-run-native-android-code-while-app-closed-or-in-background", if I wrap my native code in a plugin I can execute it.

My question is how does this work? In what way do plugins work differently? I'd like some clarity on this topic and possibly the sources.

Another very interesting thing, but not sure is related, is that whenever I wanted to edit the background task I had to rebuild the entire app. (I mean the part of the task that is NOT in the plugin).

0 Answers0