Skip to content

Commit b0bd3ad

Browse files
committed
Stop advertising before starting new adverts
1 parent d2fcc1d commit b0bd3ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ios/BLEServer.swift

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ class BLEServer: NSObject, CBPeripheralManagerDelegate {
5151
addServices()
5252
}
5353

54+
if peripheralManager.isAdvertising {
55+
peripheralManager.stopAdvertising()
56+
}
57+
5458
log(tag: BLEServer.tag, message: "Starting BLE advertise")
5559
peripheralManager.startAdvertising([CBAdvertisementDataLocalNameKey : bleId, CBAdvertisementDataServiceUUIDsKey: [SERVICE_ID]])
5660
}

0 commit comments

Comments
 (0)