4

My app functions as both a central and a peripheral. I have the one device searching for another broadcasting my service UUID. This works fine until I connect to the peripheral. Then a "Bluetooth Pairing Request" appears on both devices asking to confirm the 6-digit code and pair with the other device. I do not want this notification to appear and I do not want devices to start appearing in the Settings -> Bluetooth.

In CBCentralManager.connectPeripheral(CBPeripheral, options: nil) I thought there might be an option that can be specified in the options dictionary to prevent the alert but there are only three and none of them do what I want.

Is it possible to read a peripheral's RSSI and characteristics without connecting? Or is it possible to connect to the peripheral without displaying a pair notification to the user?

Thanks.

UPDATE:

I have used a TSI to get this resolved. He directed me to an Apple sample project called BTLE Transfer. He says that the pairing should not happen and that it doesn't happen in the sample project. I built the project and ran it and it does present the same exact pair request that my app does. I don't know if anyone else cares or is also struggling with this but I will update my question with new information and I will answer it if I find a solution.

UPDATE #2:

I believe this is a bug in iOS 8.4. I have submitted a bug report to Apple outlining the details of the bug.

Jake
  • 319
  • 1
  • 7
  • 21
  • I'm having the exact same problem. It used to work fine a couple of months ago. However now you suddenly get a pairing popup, and when you choose 'yes' it all breaks. Choose 'no' and you're good. And it's not just iOS, OSX El Capitan suffers the same problem. – Janneman May 02 '16 at 15:20
  • Yes!! Finally someone else has encountered this. One difference though is with mine nothing breaks no matter which button you press. The bug doesn't happen when devices running iOS 8.4 are not involved. Interesting to know that it happens on OS X too. – Jake May 03 '16 at 02:56

1 Answers1

1

I was working on BLE module for my app and I encountered same problem, however after lots of R&D I found the solution. (Though Jake asked this question more than 3 years ago and he might have found the solution but I am posting my answer so that anyone else with same problem could get benefit.)

Is it possible to read a peripheral's RSSI and characteristics without connecting?

YES

Or is it possible to connect to the peripheral without displaying a pair notification to the user?

YES and NO (it depends)

As it is you who is creating the peripheral so you decide if "Bluetooth Pairing Request" is required or not. Basically you set properties and permissions on the characteristics (which are being advertised). You can see all available properties here and permissions here. So by setting CBCharacteristicPropertyRead property and CBAttributePermissionsReadable permission on the characteristic I was able to read characteristic data without pairing. You can see how to configure characteristics according to specific properties and permissions here.

MAZ
  • 864
  • 11
  • 19