Hi community,
Im trying to send some data between and android and iOS device with BLE, but I need to send some custom information on the side of iOS to android , I already try almost all the keys that the CBCentralManager provides , but I try to send some string with the key CBAdvertisementDataServiceDataKey but nothing happens,anyone to know how to send information in that key?
in advance I try to have that information without connection.
this is the function that I use to try to make that part that I explain before.
Im trying to send some data between and android and iOS device with BLE, but I need to send some custom information on the side of iOS to android , I already try almost all the keys that the CBCentralManager provides , but I try to send some string with the key CBAdvertisementDataServiceDataKey but nothing happens,anyone to know how to send information in that key?
in advance I try to have that information without connection.
this is the function that I use to try to make that part that I explain before.
Code Block func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) { if peripheral.state == .poweredOn{ let data = CBMutableCharacteristic(type: hardCodeUUID, properties: [.read], value: userName.data(using: .utf8), permissions: [.readable]) peripherialManager.startAdvertising([ CBAdvertisementDataLocalNameKey:"Jael2522",CBAdvertisementDataServiceDataKey:userName.data(using: .utf8),CBAdvertisementDataServiceDataKey:[CBUUID(string: "Jose")]]) let serialService = CBMutableService(type: hardCodeUUID, primary: true) serialService.characteristics = [data] peripherialManager.add(serialService) } }