I’m trying to connect to a fingerprint reader bluetooth device using nativescript, and I’m confused about what would be the best way to implement this.
First of all, I have some sample codes in native platforms (I will focus exclusively on Android) and I can see some of the classes have compiled functions from C files, so I understand I must make a plugin in order to be able to call these functions.
My confusion is about the use of the bluetooth plugin that already exists for nativescript: my plugin will need to maintain a Bluetooth connection, so I wonder what would be better between the following options:
- Create and use just one plugin which connects to the device and also use the fingerprint functions (use both things natively) or
- Create a plugin with just the fingerprint functions and call the nativescript bluetooth plugin (would it be possible to pass the bluetooth elements from one plugin to the other?)
Naturally, I’m trying to create the plugin writing the minimal possible code, so option one seems like repeating something already exists (even if I have the samples), but option two (if it would be possible) makes me wonder if I would need to make two bluetooth connections (one for each plugin).
Maybe there are other options, but these ones are what I thought for now. I’ll be looking for your answers.