diff --git a/internal/platform/implementation/apple/Mediums/BLE/GNCBLEL2CAPServer.m b/internal/platform/implementation/apple/Mediums/BLE/GNCBLEL2CAPServer.m index e33f458a..1c53b894 100644 --- a/internal/platform/implementation/apple/Mediums/BLE/GNCBLEL2CAPServer.m +++ b/internal/platform/implementation/apple/Mediums/BLE/GNCBLEL2CAPServer.m @@ -86,6 +86,10 @@ static char *const kGNCBLEL2CAPServerQueueLabel = "com.google.nearby.GNCBLEL2CAP _peripheralManager.peripheralDelegate = self; } + if (_PSM > 0) { + GNCLoggerInfo((@"[NEARBY] Unpublish L2CAP channel with PSM: %@"), @(_PSM)); + [_peripheralManager unpublishL2CAPChannel:_PSM]; + } if (_peripheralManager.state == CBManagerStatePoweredOn) { // Bluetooth link is already encrypted, however encryption is not required here to avoid getting // insufficient authentication errors due to initialization order.