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
'Background processes' page issue - Contents maybe deprecated #4484
Comments
@bkonyi, can you weigh in? |
Yeah, this article is out of date for the Android plugin portion. We should look into updating it or providing updated documentation. Let me know what you'd like to see done here @sfshaza2 and I'll put it on my list :-) |
@bkonyi, I'm ok if you want to update the article in-place and we can add a note saying it's been updating to the new Android plugin structure. But I'm also ok if you want to create new docs for the site. ;) |
We should really do both... :-) I was kind of hoping that we'd have a more unified background execution offering with all the work Matt C. was putting in before he left, but I think we should offer some better documentation than just referring to my article (although I don't mind the klout I've been getting from it!). I'll go ahead and update the article sometime in the next couple of weeks (I'm running for the border tomorrow, so I'll be OOO until I reach Ontario mid next week). Should we set up a meeting to discuss what proper docs should look like? |
Thank you for having attention to my issue! I am very looking forward to see the updates on the flutter website! |
@bkonyi, I am also having difficulty with the message passing between the main isolate and "background" isolate(that created in the native side). I know it could be done by ReceivePort and SendPort Class when we are creating the isolate in the dart platform. However, the way that you had introduced in the previous article seems can not be benefited from these classes. Could you please also consider to cover this topic in the next article update? Before I am submitting this issue, I did a workaround for adjusting this problem. When I would like to pass the content/message(says A) from "background" isolate to the main isolate in dart level:
I know this method is too clumsy(but it works for me), and therefore I am looking for a better suggestion to tackle this issue. |
Thanks for specifying the exact information you want to see, @tc14077! I'm sure you aren't alone in this. |
@sfshaza2, are there any progress on this issue? |
No, @tc14077, and you are unlikely to see any update in the near term, as all of Google is eyeball deep in the perf season. Beyond that, I have no idea what other higher priority tasks are on @bkonyi's plate. Since this isn't a place to get support, but to report doc errors/deficiencies, maybe you can get help from one of the sources on our community page, such as Discord or Stack Overflow. Sorry I couldn't be more help. |
ok,thanks for your concern. =] |
Yes, as @Sfshaza alluded to, we're all quite busy for the next couple of weeks so I likely won't have a chance to take a look at this for another month or so. However, if you're looking for an up-to-date example to work off of, you can take a look at the android_alarm_manager code which has already been migrated to the new Android embedding. |
Thanks, @bkonyi! By the way, I use sfshaza2@, not Sfshaza@. (It's a long and boring story.). :D |
cool, thanks!! |
I've updated the article with examples that use the v2 Android embedding and pushed the relevant changes for the example plugin. Let me know if you run into any issues or have feedback! |
Hi, @bkonyi However, I am facing issues after I followed the steps that given in the guide. As plugin registration is done via reflection in the V2 embedding, I skipped the following codes.
and try to use following codes to create a new Flutter background isolate (FlutterEngine i guess):
The isolate creation seems work fine after changing these codes, but there are some plugins (e.g., path_provider) are failed to call in the created isolate (i.e., background isolate). The MissingPluginException is raised after using it in the background isolate. I believe it may caused by the plugin not be registered appropriately. Are there any missing steps that leading this exception happen? Or are there any workaround for me to use plugin in the background isolate? If this issue can be solved, this guideline can help others to get a practical experience on running Dart code in background. Any suggestion is appreciated and welcome! UPDATE UPDATE2 UPDATE3 |
Page URL: https://flutter.dev/docs/development/packages-and-plugins/background-processes.html
Page source: https://github.com/flutter/website/tree/master/src/docs/development/packages-and-plugins/background-processes.md
Description of issue:
I am a flutter developer and I had followed Ben Kony's excellent guideline to create my application with background process under flutter SDK version 1.9. However, the example mentioned in this page does not adapted the changes on flutter SDK version 1.12. As I understanding, flutter had introduced a new way to register plugin in the release of SDK version 1.12. Flutter team also provided a clear guideline to demonstrate the necessary change on the pre 1.12 Android projects. The page mentions a very important motivation to ours which is the plugins will not work on older pre-1.12 Android projects if it developed exclusively on the new plugins API.
Unfortunately, the example that provided by the Ben, Executing Dart in the Background with Flutter Plugins and Geofencing, is using the pre 1.12 way to register the plugins for "background" Application. It makes the plugins all working in background limited under V1 embedding which are still using PluginRegistry way to register the plugin. And, some new plugins that developed exclusively on the new plugins API become not applicable in the end.
Since I am still new to flutter, I almost tried my best to browse the internet for finding a way to deal with this issue but I failed. Can flutter team suggest a better way to implement background process for the flutter project after SDK version 1.12?
The text was updated successfully, but these errors were encountered: