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

获取签名的过程中,网络不好时,会造成主线程堵塞 #384

Open
chenyingchao opened this issue Mar 21, 2018 · 0 comments
Open

Comments

@chenyingchao
Copy link

chenyingchao commented Mar 21, 2018

Base Info for this issue

// MARK: - Signature

  • (AVIMSignature *)getSignatureByDataSourceWithAction:(NSString *)action
    conversationId:(NSString *)conversationId
    clientIds:(NSArray<NSString *> *)clientIds
    {
    AssertRunInIMClientQueue;

    NSString *clientId = _clientId;

    __block AVIMSignature *signature = nil;

    id signatureDataSource = _signatureDataSource;

    if (signatureDataSource) {

      SEL aSel = @selector(signatureWithClientId:conversationId:action:actionOnClientIds:);
      
      if ([signatureDataSource respondsToSelector:aSel]) {
          
          dispatch_sync(dispatch_get_main_queue(), ^{
              
              signature = [signatureDataSource signatureWithClientId:clientId
                                                      conversationId:conversationId
                                                              action:action
                                                   actionOnClientIds:clientIds];
          });
      }
    

    }

    return signature;
    }

在AVOSCloudIM 9.0.1中 , 获取签名的过程中,网络不好时,会造成主线程堵塞。

  1. ChatKit Version:0.7.17
  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.

  1. 在AVOSCloudIM 9.0.1中 APP启动
    2.获取签名

2. Please help me in this way.

在9.0之前版本 是在子线程调用签名

3. Here is a Demo.

4. Here is my Debug log

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

1 participant