0

I am trying to implement a Bluetooth pairing programatically between a device and mobile app. I am able to pair the device but the problem is that it requires user to enter the passcode which I don't want in my app. I want to do that programatically. I need to provide the device name and the passcode programatically. I am using the library react-native-ble-plx. I could not find documentations related to this in the library.

Could someone please help me with this?

  • What device are you connecting to? – Michael Kotzjan May 27 '21 at 08:49
  • It is a gateway with BLE – Aarthi Govardhanan May 27 '21 at 10:55
  • The gateway probably has secured characteristics which is why pairing is needed. There are different possible pairing methods that get selected based on the devices capabilities. The gateway developer probably selected the passkey method which is why your smartphones OS asks for the password. The popup asking for the passkey is opened by android/ios, not your own app or the library. If the passkey is required to connect this will happen with any existing BLE app and there is nothing you can do. Is there any mention of the pairing method in the gateway documentation? – Michael Kotzjan May 27 '21 at 11:13
  • Hi @M. Kotzjan, Thank you for the information. Is there a way I could suppress this behavior in the adroid and ios Layers? – Aarthi Govardhanan May 28 '21 at 13:04
  • There are many questions about this topic on stackoverflow, many people want to do that as well. I don't think this is possible even using the default language (java, kotlin, swift, etc). This could be a good question for the maintainer of react-native-ble-plx. You can create a new issue here: https://github.com/Polidea/react-native-ble-plx/issues – Michael Kotzjan May 30 '21 at 08:00
  • 1
    Thank you @M.Kotzjan – Aarthi Govardhanan May 31 '21 at 12:28

0 Answers0