react-native-ble-manager icon indicating copy to clipboard operation
react-native-ble-manager copied to clipboard

calling read() to get the device serial for pin pairing sometimes doesn't prompt the pin modal

Open cfradella opened this issue 2 years ago • 1 comments

Describe the bug On iOS, calling read() to get the serial characteristic from the device, normally prompting the pin pairing modal, occasionally returns null as though the modal came up and was cancelled/wrong pin typed in. It fails about 25% of the time, and succeeds 75% of the time.

To Reproduce Steps to reproduce the behavior: Calling the following line: const char = await BleManager.read(deviceId, serviceUUID, characteristicUUID);

Expected behavior Calling this read() prompts the user to type in a pairing pin every time.

Smartphone (please complete the following information):

  • Device: iPhone 13 mini
  • OS: iOS 16.6
  • react-native-ble-manager version: 10.1.3
  • react-native version: 0.72.3

Additional context We've made sure retrieveServices() is always called before a read() call.

cfradella avatar Aug 17 '23 21:08 cfradella

Hi @cfradella , the library only uses OS calls, this behavior may be caused by a device or OS problem.

marcosinigaglia avatar Dec 04 '23 11:12 marcosinigaglia

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

marcosinigaglia avatar Mar 04 '24 02:03 marcosinigaglia

I'm witnessing similar behavior.

If the peripheral requires pairing before reading something but isn't accepting any pairing requests, the read resolves with null value.

vhakulinen avatar Mar 15 '24 12:03 vhakulinen