Maybe this question duplicate but my situation is different from others.
I have a own bluetooth kit. It puts manufacturer spesific data when click button on kit. I'm getting manufacturer data from android. But I cannot access from ios app.
I listen advertising data as below :
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
for (key,value) in advertisementData{
print("key:(key) value:(value)")
}
}
And log result :
key:kCBAdvDataIsConnectable value:1
key:kCBAdvDataServiceUUIDs value:(1802)
key:kCBAdvDataLocalName value: R009
By the way, I tried CoreLocation api for seeing my ble devices.
func startScanBeacons() {
let uuid = UUID(uuidString: "b9407f30-f5f8-466e-aff9-25556b57fe6d")!
let beaconRegion = CLBeaconRegion(proximityUUID: uuid, identifier: "mybeacon")
beaconRegion.notifyOnEntry = true
beaconRegion.notifyOnExit = true
locationManager.startMonitoring(for:beaconRegion)
locationManager.startRangingBeacons(in: beaconRegion)
}
But it didn't work. My device doesn't show as beacon. After some research on stackoverlow, some people say : this is not possible.
You can look at this answer : https://stackoverflow.com/a/46373130/3170065.
But there must be a workaround getting manufacturer data. What should I do to overcome this problem ? We can customize ble firmware.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…