macOS12.x, BLE kCBAdvDataLocalName is empty

When I startAdvertising, my localName is long, more than 8 bytes. like @"123456789".

   [_peripheralManager startAdvertising:@{
            CBAdvertisementDataLocalNameKey: @"123456789",
            CBAdvertisementDataServiceUUIDsKey: @[[CBUUID UUIDWithString:@"bbbb14c7-4697-aaaa-b436-d47e3d4ed187"]]
            }];

When running on macOS 11.x though localName exceeds 8 bytes. But it can still be scanned.

{
  kCBAdvDataIsConnectable = 1;
  kCBAdvDataLocalName = 123456789;
  kCBAdvDataRxPrimaryPHY = 0;
  kCBAdvDataRxSecondaryPHY = 0;
  kCBAdvDataServiceUUIDs =   (
    "BBBB14C7-4697-AAAA-B436-D47E3D4ED187"
  );
  kCBAdvDataTimestamp = "680712553.800874";
  kCBAdvDataTxPowerLevel = 12;
}

But running after macOS 12.x, if localName exceeds 8 bytes, it will be completely ignored. In the scanned data, localName is empty.

{
  kCBAdvDataIsConnectable = 1;
  kCBAdvDataRxPrimaryPHY = 0;
  kCBAdvDataRxSecondaryPHY = 0;
  kCBAdvDataServiceUUIDs =   (
    "BBBB14C7-4697-AAAA-B436-D47E3D4ED187"
  );
  kCBAdvDataTimestamp = "680712744.108894";
  kCBAdvDataTxPowerLevel = 12;
}

On macOS11.x, SCAN_RSP is utilized if localName exceeds 8 bytes,

while on macOS12.x, SCAN_RSP is always empty.

  1. Why are there differences between macOS11.x and macos12.x, is there any documentation?
  2. What is the maximum limit for localName? (On macOS 11.x, I verified it was 29 bytes
  3. Are there other ways to broadcast longer data?

Does anyone know why? This has bothered me for a long time...

Hello, have you identified the cause of this issue? I’m encountering a similar problem on macOS 15.x and 26.x. When I try to send a 128-bit UUID or a 16-bit UUID, according to the official documentation, if the name is too long and the advertising data exceeds 31 bytes, the local name will be placed in the scan response. On iOS, the local name is indeed placed in the scan response, but with the same packet on macOS, the local name is directly discarded. Do you know how to avoid this issue?

macOS12.x, BLE kCBAdvDataLocalName is empty
 
 
Q