Bluetooth scanner device receive data in React Native - react-native

I want to make in React Native a app that connects to a bluetooth scanner device, and receive data from it (barcodes id) after the scanned was made. It is possible? What I need to use?
Thank you!

You can scan barcodes directly from your phone and there are libraries that support such functionality for react native. However if using a bluetooth scanner device is a requirement then you have two options you can choose from -
Get access to bluetooth functionality through Native Modules
Use an existing library that provides bluetooth capabilities to react-native. A really good option can be this library https://github.com/Polidea/react-native-ble-plx
In general it is possible to achieve what you need

Related

Send text data via Bluetooth using React-Native App

I have a Bluetooth (BLE) Module connected to an Arduino and I would like to send a simple text string to it using a React-Native app. Once the string is sent, the Arduino will do some processing.
I've tried using react-native-ble-plx but I've a feeling that isn't the right way to pass the text input to. I've tested using the Bluetooth Terminal Android app and was able to send text data to my Bluetooth Module/Arduino device. I basically want to replicate that.
In my react-native app, i'm able to connect to the Bluetooth Module but not able to send any data.
So, does anyone know which libraries I should be doing to send simple text data? Thanks.
react-native-ble-plx is far enough to do so. You can check out our side project which uses this lib to send colors to Arduino and handle LED lights https://github.com/SparingSoftware/HomeLed

How to read data in background in React Native

I have an app in React Native, that uses the bluetooth connection to read data from external devices.
I need a way to continue to read this data in background when, for example, the user starts a reading session and put the app in background.
What should I use to do this?
My code is divided in two parts:
Scan and Connect
Reading Data from external devices.
You need a background service for this. The following link for Android will help you.
github => react-native-foreground-service
If you want, you can do it yourself as described on the RN official site. But you'll have to write Java code for it.
React Native => Native Module

React Native set TextInput default using native voice input

I want my textinput default using voice input, just like in ios it can automatically switch to use native voice input to input text, and for android it can automatically switch to use google voice input to input
is it possible to do it by react native or using native code? Thanks!
You can use a third party library react-native-voice
This library is compaitable with both android and ios. There is a fine introduction on medium site too.
For Google voice input, This component uses the device’s native recogniton API, which varies for every device. Google Speech API is an external service that you have to pay for, whereas this costs no money.

How to use Voximplant text chatting together with React Natiwe?

Use Voximplant text chatting along with React Native.
Has anyone used it? What ways did you use if there is no plug-in?
Voximplant is used mainly for Voice and Video communications. Text messaging is a pretty new addition and it has not yet landed in the React Native SDK (it will, but in some time).

React Native: Activity and metrics tracking libraries?

I'm looking into adding a tracking library (something like what Google Analytics does for the web) to my React Native app.
Are there tools out there to track user activity like swiping, tapping on stuff, etc? I did a quick search but didn't find anything.
To track events you can use google analytics in react-native either as a javascript or a native implementation.
The key difference is that in the native implementation you get a some metadata handled automatically. ( such as device UUID, device model, viewport size, OS version ).
Javascript implementation: https://github.com/react-ga/react-ga
Native bridge: https://github.com/idehub/react-native-google-analytics-bridge