Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xhzengAIB committed May 20, 2015
2 parents 49007cd + 45c43e7 commit 5e0145f
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,15 @@ - (void)viewDidLoad
}];
}
}];
}

// 这里也要把 setupDidReceiveTypedMessageCompletion 放到 viewDidAppear 中
// 不然, 就会冲突, 导致不能实时接收到对方的消息
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

WEAKSELF
[[LeanChatManager manager] setupDidReceiveTypedMessageCompletion:^(AVIMConversation *conversation, AVIMTypedMessage *message) {
// 富文本信息
if([conversation.conversationId isEqualToString:self.conversation.conversationId]){
Expand All @@ -129,6 +137,11 @@ - (void)viewDidLoad
}];
}

- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[[LeanChatManager manager] setupDidReceiveTypedMessageCompletion:nil];
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
Expand Down

0 comments on commit 5e0145f

Please sign in to comment.