How do I broadcast a Bluetooth signal while in the foreground and background in Swift?

365 views Asked by At

How do I broadcast a bluetooth signal in Swift? My goal is to then discover this device with another device. I have tried using the CBPeripheralManager.startAdvertising function but CBPeripheralManager.isAdvertising always returns false.

Also how does broadcasting in the background work? Is it any different than broadcasting in the foreground? The Core Bluetooth Programming Guide says that you should assign your manager a restoration identifier but I don't know how to do this.

Thanks!

0

There are 0 answers