Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS CoreBluetooth: Is there a way to do JustWorks pairing without showing the alert view on iOS?

I am using my iPhone as a central device and connecting to a peripheral to read a protected characteristic.

In my scenario, for pairing, the Central (iPhone) has both Keyboard and Display, and the peripheral responds with no input and no output capabilities.

That forces the Central (iPhone) to perform Just Works pairing.

As per Wikipedia- "Just works: As the name implies, this method just works, with no user interaction. However, a device may prompt the user to confirm the pairing process."

On the iOS device, unfortunately, the BLE stack automagically pops up an alert view to prompt the user to confirm or cancel the pairing process, and as such at least the first time a user intervention is required (AFAIK, this alert view is generated by the iOS BLE stack and we cannot prevent it from appearing, from an application programming level).

My question is- is there a way I can silent this alert view so that the pairing goes through without any user intervention?

I am running iOS8.3 on an iPhone6.

like image 222
Subzero Avatar asked May 01 '15 17:05

Subzero


1 Answers

That's how 'Just Works' behaves on iOS. As you noted it removes the pass-key requirement but there's no removing the user-interaction step for bonding.

The accepted answer isn't correct as a pass-key isn't required & there's no public Apple API for out-of-band bonding. This answer covers it in more detail; https://stackoverflow.com/a/29338255/232113

like image 88
BruceBannor Avatar answered Sep 20 '22 01:09

BruceBannor