CodeMinion / another_brother

Another Brother Flutter SDK
BSD 3-Clause "New" or "Revised" License
21 stars 19 forks source link

iOS Bluetooth Not Working #50

Closed mikhael28 closed 1 year ago

mikhael28 commented 1 year ago

Hi there! On iOS, in Another Brother Prime and in my local build, a physical iOS device is not picking up bluetooth devices that the same code on Android does. Looking in the XCode logs, we actually can see that the device knows it is connected to the QL 1110NWBc - but those are system level logs. When I try to use flutter blue plus, including the older version and the newer/latest version of the package in my application (separate from the another brother dependency) it does not pick up any bluetooth devices, even though the iPad is connected to both the printer and a pair of bluetooth headphones - this leads me to think perhaps flutter blue plus broke with the latest version of flutter or newer version of iOS.

Does this sound familiar to anyone?

CodeMinion commented 1 year ago

Hi @mikhael28 !

Thanks for reaching out about this! Could I trouble you to share a bit more details as to what another_brother call you are using for finding your Bluetooth printers?

Thanks in advance,

mikhael28 commented 1 year ago

Running printer.getNetPrinters([Model.QL_1110NWB.getName()]) - running on XCode 14.3, Ventura 13.3.1a will return the brother printer if I connect to it through Wifi.

Running printer .getBluetoothPrinters([Model.QL_1110NWB.getName(), Model.QL_1100.getName(), Model.QL_1115NWB.getName(), Model.QL_820NWB.getName()]) returns an empty array, even though XCode will have some lower level system logs. I tried using flutter blue plus independently to see if I could find the connected devices that way, but no dice. I think flutter blue plus might be broken - I'm also running bleeding edge Flutter stable.

CodeMinion commented 1 year ago

Thanks for the additional details @mikhael28. In the case of another_brother and Bluetooth Classic we don't rely on flutter_blue_plus for to find the bonded printers. Instead it uses the native Brother SDK method for finding those printers on iOS.

Could you confirm if on iOS you are connected to the printer? That is, on settings go to the printer that is paired and tap it to ensure it says connected.

Thanks in advance,

mikhael28 commented 1 year ago

I can confirm that iOS was connected to the printer on bluetooth, the in bluetooth system settings. Is there a different settings I need to be looking for?

mikhael28 commented 1 year ago

Is this ringing a bell for anyone? could not find protocolID for protocolString com.brother.ptcbp

mikhael28 commented 1 year ago

I am closing this issue, because of good news - bluetooth printing is working, in iOS, in production. Meaning, the same code that works for bluetooth printing, works perfectly for iOS printing.

The rub for all this, is that the printing was not working on my local test device. I was build and running the application through XCode, onto an iPad that was connected to XCode directly through USB. For whatever reason, the bluetooth printers would not be detected on that local test device, but I had a customer tell me yesterday that when they are running that code on App Store deployed version of the app - it all works like it should.

So, closing, but everyone should be aware that local iOS had trouble discovering the devices.