CBAdvertisementDataTxPowerLevelKey cannot be set when advertising.

occur warning.
[CoreBluetooth] WARNING: The advertisement key 'Tx Power Level' is not allowed

I am trying to do adversing using bluetooth. To set txPower, I set it as the code below. But I get a warning. Why? How can I set it up?

Code Block Swift
var advertisingData = [String : Any]()
      if let message = self.message {
        advertisingData[CBAdvertisementDataLocalNameKey] = message
      }
      advertisingData[CBAdvertisementDataTxPowerLevelKey] = NSNumber(value: 1)
       
      if let peripheralManager = self.peripheralManager {
        peripheralManager.startAdvertising(advertisingData)
        }
      }


advertisement just support CBPeripheralManagerOptionShowPowerAlertKey and CBPeripheralManagerOptionRestoreIdentifierKey.

https://developer.apple.com/documentation/corebluetooth/cbperipheralmanager/peripheral_manager_initialization_options

FYI: https://stackoverflow.com/a/25652023/14123004
CBAdvertisementDataTxPowerLevelKey cannot be set when advertising.
 
 
Q