I have an app with CBPeripheralManager that advertising input service (00001812-0000-1000-8000-00805f9b34fb).
Works great, but my Apple Watch (which is paired with my iPhone) on which the app runs, connects to my service.
Is there a way to control what devices are allowed to connect?
00001812-0000-1000-8000-00805f9b34fb
is a standard HID (Human Interface Device) service UUID, and you will find that many devices might be scanning for that at any time, and could request a connection whether you want it or not.
While it is possible to perhaps identify the device by turning around the connection, and disconnect if it is not the right device, this will, at least in your case, would only cause the whole thing to loop again. And once you disconnect the watch and start advertising the HID service, the watch (which is almost always near the phone) will want to connect again, and again, and again.
It is not possible to prevent certain devices from connecting at all. Only after a connection you can know what device it is has connected.
Argun Tekant / DTS Engineer / Core Technologies