Closed lillianho closed 7 months ago
Hi @lillianho ,
Thanks for reaching out about this. Could I trouble you to share the code you are using for printing and finding the printers?
Based on the logs I see that the app is trying to check the paired devices as well as perform a BLE scan. None of these are performed unless the respective APIs are call.
Thanks in advance,
Hello @CodeMinion,
Sorry, I just realised that the demo app had several pages - one of which had the wifi logic separate from the bluetooth one. I also just realised I could check permissions first before calling scan_bluetooth, so there is actually no problem.
Just another question, is there any way to do a search of all printers on the network without defining the Printer/ PaperInfo upfront?
We are trying to support as many wifi printers and paper (cut/uncut/dimensions) as we can (that fall under the list of another_brother's support), and we'd planned to scale the print job according to what paper installed in any printer.
Can we do a printer search that return all printers, regardless of model and get returned PaperInfo from the discovered printers so that we don't have to define that ourselves?
If there is no way to do so, what would be the best way to implement another_brother to support as many paper/printers as possible?
Many thanks, Lillian
Hi @lillianho ,
Glad you were able to find the cause.
With regards to finding the printers, you could use the printers list and pass it to the search function. I have not tested with so many printers myself so can't say from experience whether it will work as intended. https://github.com/CodeMinion/another_brother/blob/main/lib/printer_info.dart#L385
As for the paper, only some of the Brother models support querying the paper installed in the printer. If I remember correctly it's something mainly the QL and PT printers can do. https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/android/printer.html#getlabelinfo
The approach I have normally seen others follow is to have a way for the users to select the correct paper option based on the printer. Here is an example project for configuring printer and the papers based on the selected printer: https://github.com/CodeMinion/Printer-Configuration-UI
Thanks again for reaching out. Hope this helps but don't hesitate to reach out anytime if there is anything else I can help with,
Hi,
We have been testing with this package and have found that if our physical Android device is on OS 13, and if the build is targeting Android sdk 33, without accepting the bluetooth_scan and bluetooth_connect permissions, our app will crash with the following exception:
We tested using the latest version of this package: 2.1.1.
This is not an issue on physical Android devices that are below OS 13. We have also simulated the exact issue in https://github.com/CodeMinion/Demo-Another-Brother-Prime - we modified the pubspec to target the latest version of this package as well.
I do appreciate that permissions are required for bluetooth scanning to succeed.
However, we are only interested in looking for printers via WIFI and not bluetooth, so we don't want to make it mandatory for users to accept bluetooth permissions.
Also, if we explicitly decline the bluetooth_scan and bluetooth_connect permissions, the app also crashes in the same manner, which means our app doesn't work unless users explicitly agree to bluetooth permissions outright. The app doesn't crash in the case where users do explicitly accept bluetooth_scan and bluetooth_connect permissions.
Users should be able to decline whatever permissions they wish, and our app will respond to their permissions by allowing them or disallowing them to print instead of crashing the app, ideally.
This may be a limitation of the brother api rather than the intended behaviour of this package, so any suggestions about what can be done is much appreciated.
Many thanks, Lillian