Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Bluetooth Pairing Request Dialog - Can I know the user's choice?

I'm trying to create a BLE pairing user-experience screen in my app. The app scans for our BLE device, and when discovered, automatically connect it to the centralManager. The System then shows a Bluetooth Pairing Request dialog (not part of my app, but iOS's). The user has two options - Pair/Cancel. Thing is - Even when the Cancel action is being selected by the user - The peripheral still stays connected to the centralManager. (the centralManagerDidConnect function is being trigger) Even though it's not paired with the phone. Is there any way that I can know if the user chose to pair the device, or to cancel the pairing ??? Thanks!

like image 463
Shahar Biran Avatar asked Nov 29 '17 06:11

Shahar Biran


People also ask

How do I find Bluetooth paired devices?

Make sure Bluetooth is turned on. Touch and hold Bluetooth . In the list of paired devices, tap a paired but unconnected device. When your phone and the Bluetooth device are connected, the device shows as "Connected."


1 Answers

Find my detailed answer to a similar question here.

You should basically write to a characteristic of the device after pairing and check if the write was successful

like image 123
Gurunath Sripad Avatar answered Sep 30 '22 20:09

Gurunath Sripad