SDK 版本 LeanCloud-Swift-SDK/17.6.0
...创建对话:
do {
try Client.current.createTemporaryConversation(clientIDs: members, timeToLive: 3600)
{(result) in
switch result {
case .success(value: let tempConv):
print("临时对话creator: \(tempConv.creator)")
case .failure(error: let error):
UIAlertController.show(error: error, controller: self)
}
}
} catch {
UIAlertController.show(error: error, controller: self)
}
...接收:
Client.addEventObserver(key: self.uuid) { [weak self] (client, conversation, event) in{
print("临时对话creator (conversation.creator)")
}
以上代码分别在真机和模拟器运行(真机创建临时对话,模拟器接收信息),真机能打印出creator,模拟器打印的是nil