Jitendra Modi
Jitendra Modi

Reputation: 2394

How can I check that iPhone's Bluetooth is connected to other device / accessories or not?

I am working on an application which includes Bluetooth connection pairing. So I want to know if bluetooth is connected to other device or any accessories?

Check that bluetooth is paired or not in iPhone?

Upvotes: 0

Views: 657

Answers (1)

Duyen-Hoa
Duyen-Hoa

Reputation: 15784

You can try to use the CBCentralManager to retrieve connected bluetooth device to your device. When your bluetooth device is on (CBCentralManager status == CBCentralManagerStatePoweredOn), call this function:

func retrieveConnectedPeripherals(withServices serviceUUIDs: [CBUUID]) -> [CBPeripheral]

It gives your the list of UUID of all service connected to your iPhone.

Ref: https://developer.apple.com/reference/corebluetooth/cbcentralmanager/1518924-retrieveconnectedperipherals

Upvotes: 1

Related Questions