CYLChatKit
CYLChatKit copied to clipboard
Bug&Fix:录音时有弹窗,录音会无法停止,只能杀掉APP
Base Info for this issue
Bug: 输入语音消息,录音时有弹窗(Alert),录音会无法停止,只能杀掉APP 非常影响用户体验
- ChatKit Version:2.1.1
- App-ID: XX
- Language:Swift + Objective-C
- iOS System Version:iOS12
- Prototype(是否是真机):都有
- 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事件的监控,如果被系统事件中断,即取消录音
收到,多谢