How to find connected perepheral for the device connected in iPHONE general setting swift

I am working on IOT headphone based application .Is there a way to find the connected devices in iPhone setting using core bluetooth or any another framework in swift.

Yes! You can use the CoreBluetooth framework and more specifically the scanForPeripherals function.

Since you may not know the service UUIDs of the devices, you can just pass nil and it should give you ALL bluetooth devices it can find in the area.

You can also try retrieveConnectedPeripherals but it does also ask for an array of service IDs. I’m unsure if passing an empty array here will work as it’s not mentioned in the docs like it is for scanForPeripherals. I hope this at least puts you on the right track.

1 Like

@beaunouvelle Thanks For helping.
As per my implementation scanForPeripherals just gives the nearby available devices but in my case i only need the connected device which is connected in setting and if by scanForPeripherals we got all the nearby device how to identify which device is connected to setting is there a way to identify.

This topic was automatically closed after 166 days. New replies are no longer allowed.