Search code examples
bluetoothbluetooth-lowenergycore-bluetoothcbperipheralcbperipheralmanager

Change advertising iPhone local name


Using the CoreBluetooth framework is it possible to change the peripheral name of an iPhone that is advertising in peripheral mode?

For example: I would like the peripheral iPhone to broadcast a custom name and have another iPhone be able to read the name upon central mode scan.

Is it possible to set the GAP name on a peripheral advertising iPhone?


Solution

  • You must modify the Advertising Data when starting the Advertising. Add a Complete Local Name AD field.

    [myPeripheralManager startAdvertising:@{ CBAdvertisementDataLocalNameKey:
        INSERT_NAME_HERE }];