Attached .aia has the blocks and a bit more comments
I was trying to connect a bluetooth heartrate monitor ( smartwatch ) to iOS AppInventor companion (TestFlight version 2.78.4) by subscribing to the heartrate bluetooth service. Every block worked, except for when I got to BytesReceived. Merely adding the block ( even empty ) caused the periodic error in the companion app:
wrong number of arguments (1 for 3). Irritants: ()
At some point I tried replacing the RegisterForBytes with RegisterForStrings ( and correspondingly switched BytesReceived for StringsReceived ) and the entire bluetooth chain worked, proving the problem is the block itself.
The downside is that the output is the corresponding ASCII character and ( presumably ) goes no higher than 127bpm ( above 127 the character no longer shows in the label ), but this will mostly suffice for the project I have.
Help is not needed. I am mostly reporting a bug that meaningfully impacts bluetooth on iOS. Though I would like the option to go higher in case I ever need to.
I've looked at the sources and you are correct. The callback function is only passing the values, disregarding the service and characteristic UUIDs (hence the 1 of 3 error). I should have a fix shortly.
Thank you! I have just tested the new BytesReceived, and it works without any issues.
After testing a few times:
an already-broadcasting smartwatch, already set up as a bluetooth device in the settings.
a smartwatch ( already set up as a bluetooth device in the settings ) that started broadcasting after app started scanning.
Can confirm that:
BLE on
iOS 26.4.1
TestFlight AppInventor companion 2.78.4 build 3
has successfully and with perfect repeatability:
Scanned for and found a bluetooth device based on service UUID:
0000180D-0000-1000-8000-00805F9B34FB
( using ScanForService )
Connected to the device
( using .Connect with index )
Subscribed to the service and characteristic UUID ( bluetooth heart rate service ):
0000180D-0000-1000-8000-00805F9B34FB
00002A37-0000-1000-8000-00805F9B34FB
using RegisterForBytes
Received and displayed to a label:
correct ServiceUUID,
correct CharacteristicUUID,
the heart rate displayed on my watch ( even when it goes above 127 bpm )
using BytesReceived
All with no manual intervention of any kind on the user’s side, except for a one-time set up of the bluetooth device in the iOS settings.