ChatKit-OC
ChatKit-OC copied to clipboard
fetchProfileBlock会被重复调用
Base Info for this issue
- ChatKit Version:0.8.14
- App-ID: XX
- Language:Swift
- iOS System Version:iOS10
- Prototype(是否是真机):YES
- Q-A 为什么conversation只有两个成员的时候,fetchProfileBlock会被调用十几次,其中一个成语的id会重复出现
1. How to repeat the problem.
LCChatKit.sharedInstance().fetchProfilesBlock = {
userIds, completionHandler in
guard let userIds = userIds else {
completionHandler?(nil, nil)
return
}
var users = [LCCKUser]()
let query = AVQuery(className: "_User")
print("userIDs: \(userIds)")
for userId in userIds {
query.whereKey("username", equalTo: userId)
guard let object = query.getFirstObject() as? AVUser else {
completionHandler?(nil, nil)
return
}
let user = LCCKUser(userId: object.value(forKey: "nickname") as! String!, name: object.value(forKey: "nickname") as! String!, avatarURL: URL(string: AVUser.current()?.value(forKey: "avatarURL") as! String))
users.append(user!)
}
completionHandler?(users, nil)
}
结果是: userIDs: ["ha_pku_edu", "achen_pku_edu""] successfully fetched conversation userIDs: ["achen_pku_edu"] userIDs: [""achen_pku_edu""] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"] userIDs: ["achen_pku_edu"]
解决了吗,我目前也遇到这个问题