如何检测蓝牙 PTT 麦克风上的 PTT 按钮按住 iOS

How to detect PTT button holding on Bluetooth PTT microphone iOS

我有蓝牙 PTT 麦克风 (Delking PTT Bluetooth Mic)

现在我想在 iOS 的小型 PTT 应用程序中使用它,我的问题是我不知道如何检测 PTT 按钮是 hold/release,我可以看到 Zello 应用程序效果很好。

大家有什么想法吗?

您可以使用耳机遥控器API来控制这个蓝牙麦克风

- (void) remoteControlReceivedWithEvent: (UIEvent *) receivedEvent {
    if (receivedEvent.type == UIEventTypeRemoteControl) {
        switch(receivedEvent.subtype) {
            case UIEventSubtypeRemoteControlTogglePlayPause:
                //Insert code

            case UIEventSubtypeRemoteControlPlay:
                //Insert code for HOLDING BUTTON
                break;
            case UIEventSubtypeRemoteControlPause:
                // Insert code for RELEASE BUTTON
                break;
            case UIEventSubtypeRemoteControlStop:
                //Insert code.
                break;
            default:
                return;
        }
    }
}