Skip to content
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

Uses UIThread on Android when using channel #39

Closed
wants to merge 3 commits into from

Conversation

GauteHaugen
Copy link

Looks like after flutter 1.6 you need to jump back to the UIThread before sending messages over a channel
More info here: https://flutter.dev/docs/development/platform-integration/platform-channels#jumping-to-the-ui-thread-in-android

Since I don't own any ios devices, I can't test if the changes made to flutter 1.6 broke this plugin for ios as well. But since there is a chapter for making the switch to the main thread on ios as well, I would assume so. More info here: https://flutter.dev/docs/development/platform-integration/platform-channels#jumping-to-the-main-thread-in-ios

@GauteHaugen
Copy link
Author

If you want I could write the code for ios for switching to the main thread, but I would have no way of testing if it works before or after my changes

@matteocrippa
Copy link
Collaborator

@GauteHaugen for iOS I can test on my side, strange the forced that to run in the UI thread, btw I will have a look into that.

Dunno if not safer create a separate branch for this breaking change, test a bit and then merge into master if all fine

@GauteHaugen
Copy link
Author

As far as I understood this is the way to do it after flutter 1.6. So if people use flutter 1.6+ it will not work without forcing it back onto the main thread (The app will start and everything seems normal, but no response is made when scanning a nfc tag). How this would affect people that use flutter versions before 1.6, is unknown for me. But I could download some previous versions of flutter and test it on android to see if it would break the program.

@alex-deutsch
Copy link
Collaborator

closing it, fix was also part of my Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants