ChenYilong / ChenYilong/CYLChatKit

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

Open
#3 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
69
Forks
9
PR merge metrics
No merged PRs in 30d

Description

## 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事件的监控,如果被系统事件中断,即取消录音

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in LCCKChatBar.m and inspect the existing voice-record button handlers. Reproduce the issue by showing an Alert two seconds after recording begins, then verify that an interrupted or cancelled touch stops recording instead of leaving the app stuck. Done means the recording can be stopped safely after the interruption on iOS 12 devices.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.