CoreBluetooth中不允许使用广告键“制造商数据”

我正在使用核心蓝牙框架。 我正在尝试使用此框架来创build外设。 我的外围设备使用以下方式公布数

manager=[[CBPeripheralManager alloc]initWithDelegate:self queue:nil]; [manager startAdvertising:dictionary]; 

这里我给广告传的字典是:

 NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: @"name", CBAdvertisementDataLocalNameKey,@"some other data",CBAdvertisementDataManufacturerDataKey,nil]; 

当我运行应用程序时,我得到警告: 在CoreBluetooth中不允许广告键“制造商数据”

而且我没有收到我使用中央侧的密钥CBAdvertisementDataManufacturerDataKey发送的“其他数据”。 我在中央获得这个名字。 那么我怎样才能发送一些其他的数据与广告数据?

正如开始广告的CBPeripheralManager文档所述:

包含要公布的数据的可选字典。 CBCentralManagerDelegate协议参考中详细介绍了一个advertisementData字典的可能的键。 也就是说,外围pipe理器对象只支持两个键:CBAdvertisementDataLocalNameKey和CBAdvertisementDataServiceUUIDsKey

这些键仅适用于iOS设备处于中央模式并正在发现外部外围设备(即只读)的情况。 我不知道为什么这个限制是在外设模式下运行的,你可以尝试提交一个bug报告。