Search code examples
iosiphoneswiftxcodecore-bluetooth

Core Bluetooth: Send data between 2 iOS devices


I've been programming with swift for a bit now, but I'm completely new to Core Bluetooth. Is there a way to send primitive data (integers, characters) from one iOS device to another using Core Bluetooth?

Thanks in advance


Solution

  • Yes. You need to make one device peripheral and the second central(or both of them). In the peripheral you need to advertise data(peripheralManager.startAdvertising) and in the central you need to get it by the characteristic. You can read all about that in https://developer.apple.com/documentation/corebluetooth