Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

2.0.4版本强制重连功能修改后出问题 #375

Open
jiang443 opened this issue Jan 10, 2018 · 1 comment
Open

2.0.4版本强制重连功能修改后出问题 #375

jiang443 opened this issue Jan 10, 2018 · 1 comment

Comments

@jiang443
Copy link

jiang443 commented Jan 10, 2018

Base Info for this issue

2.0.4版本强制重连功能修改后出问题

2.0.4版本强制重连功能修改后,无法重新连接服务

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

1. How to repeat the problem.

A B两台手机先后登录同一个账号,A手机强制登录失败。点击进入对话页面,无法获取到对话历史。
(已经打开多点登录相关设置)

之前使用的1.0.2版本没有这个问题。此处代码恢复到之前版本,问题解决。

2. Please help me in this way.

修复此问题,可以考虑恢复此处代码。

3. Here is a Demo.

4. Here is my Debug log

直接修改SDK的源码:

你在 LCChatKitExample+Setting.m 中,
函数lcck_setupForceReconect中,以下新代码删除即可

if (granted == YES) {

             NSString *title = @"正在重连聊天服务...";
             
             // 从系统偏好读取用户已经保存的信息
             NSUserDefaults *defaultsGet = [NSUserDefaults standardUserDefaults];
             NSString *clientId = [defaultsGet stringForKey:LCCK_KEY_USERID];
             
             [[self class] lcck_showMessage:title toView:viewController.view];
             [[LCChatKit sharedInstance] openWithClientId:clientId
                                                    force:granted
                                                 callback:
              ^(BOOL succeeded, NSError *error) {
                  [[self class] lcck_hideHUDForView:viewController.view];
                  //completionHandler用来提示重连成功的HUD
                  !completionHandler ?: completionHandler(succeeded, error);
              }];
             return;
         }
@ChenYilong
Copy link
Contributor

fix in CYLChatKit https://github.com/ChenYilong/CYLChatKit/releases
version 2.1.5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants