We started from an Android app, due to the higher count of devices among people.
It also seemed to be a little more permissive in regard to accessing the hardware features we needed: sending an advertisement properly formatted, and scanning continuously.
Aiming to deploy a quick demo on both the smartphone families, we adopted the Cordova framework, extended with plugins to drive Bluetooth hardware.
To be honest, we now know we made a mistake and we should have written native code in order to save time.
The Cordova plugins we used are intended for connecting IoT devices and the support for advertising/scanning functionalities is less than what we desired. Whatsmore, there is a big asymmetry between iOS and Android support, exceeding their natural differences, so the portability won’t be achieved without a complete refactoring.
-install the Cordova framework (with Android’s ADB) - create a Cordova empty app, and add the platform -install the plugins already mentioned ($ cordova install pluginName) - checkout the Github repo into /www directory
Please mind you will browse a test branch, in the repository of a project that never surfaced!
You need physical devices (smartphones) to be cable-connected to the IDE, either in Android or iOS, as Bluetooth hardware response cannot be virtualized in an emulator. Whatsmore, due to interacting through a terminal, you should contemplate “hexagonal” architectures of your code, those including interfaces dedicated to testing the single units of code.