CoreBluetooth 知道广告何时停止

CoreBluetooth knowing when advertisement stops

CBPeripheralManagerDelegate 似乎没有一种方法可以在广告停止时发出通知,这与对应的 -peripheralManagerDidStartAdvertising:error: 不同。我是否应该假设 stopAdvertising 方法是同步的,并假设在广告停止后立即?

你是对的。

-(void)stopAdvertising 立即停止广告。

这来自 Apple 的 CBPeripheralManager class 参考。

Call this method when you no longer want to advertise peripheral manager data.

可能对您有帮助的(取决于您的用例)是使用 CBPeripheralManager 中的 isAdvertising 属性。