-
Notifications
You must be signed in to change notification settings - Fork 124
save BluetoothConnection variable in foreground #30
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
Comments
I found the main problem. |
It's hard to pinpoint exactly what's going on. Could you please provide some sample code or project? For network issues, try setting |
This project is part of a project I've been working on in the past. This is an example of transmitting the information of the nearest device among the discovered Bluetooth devices to the server. There is no permission handler, so manually grant location permission. It works fine on Android 10 (sdk 30). |
Even using this plugin does not prevent the destruction of the Dart code when the app is killed by the task manager. Dart code usually runs in the This plugin takes advantage of foreground service. In the Android platform, the foreground service remains in the form of a notification even when the app is closed, helping to continue the work. So we call the The |
Is there a specific solution to this problem here that can help me? |
It seems that the only way to do this is to add code to disconnect the bluetooth connection to the onDestroy function of the ReadParametersTask implementation class and restart the service when the app starts. |
How about implementing in ReadParametersTask the part that connects the bluetooth device and handles the data? It would be better to implement widgets to simply handle UI. |
Thanks for taking the time to answer this question. |
Uh oh!
There was an error while loading. Please reload this page.
Hi.
Thank you for develop this plugin.
This dependency solves all my problems except for two, which I will explain below:
how save BluetoothConnection class variable .
now BluetoothConnection variable is dead when app close from task manager.
I'm only test this on Android Devices.
I'm not able to network call in background i test two dependeny. retrofit & http
I am also in an urgent position that encourages me to do this today.
Thanks in advance for taking the time to respond to this issue
The text was updated successfully, but these errors were encountered: