CYLChatKit icon indicating copy to clipboard operation
CYLChatKit copied to clipboard

Bug&Fix:录音时有弹窗,录音会无法停止,只能杀掉APP

Open jiang443 opened this issue 6 years ago • 1 comments

Base Info for this issue

Bug: 输入语音消息,录音时有弹窗(Alert),录音会无法停止,只能杀掉APP 非常影响用户体验

  1. ChatKit Version:2.1.1
  2. App-ID: XX
  3. Language:Swift + Objective-C
  4. iOS System Version:iOS12
  5. Prototype(是否是真机):都有
  6. Issue Type:Crash、Bug、Enhancement(希望能支持一个新需求)、Q-A

1. How to repeat the problem.

输入语音消息,录音时有弹窗(Alert),录音会无法停止,只能杀掉APP

2. Please help me in this way.

录音时有弹窗,或者其他情况引起录音按钮失去焦点,此时应该停止录音。

3. Here is a Demo.

只要加一个Alert,延时2秒弹出,就可以复现

直接修改SDK的源码:

LCCKChatBar.m 中将下面的代码:

    [_voiceRecordButton addTarget:self action:@selector(startRecordVoice) forControlEvents:UIControlEventTouchDown];
    [_voiceRecordButton addTarget:self action:@selector(cancelRecordVoice) forControlEvents:UIControlEventTouchUpOutside];

替换为

    [_voiceRecordButton addTarget:self action:@selector(startRecordVoice) forControlEvents:UIControlEventTouchDown];
    [_voiceRecordButton addTarget:self action:@selector(cancelRecordVoice) forControlEvents:UIControlEventTouchUpOutside];
    [_voiceRecordButton addTarget:self action:@selector(cancelRecordVoice) forControlEvents:UIControlEventTouchCancel];   //新增UIControlEventTouchCancel事件的监控,如果被系统事件中断,即取消录音

jiang443 avatar Jan 09 '19 07:01 jiang443

收到,多谢

ChenYilong avatar May 16 '19 04:05 ChenYilong