- SendBirdUIKit (2.0.9):
- SendBirdSDK (~> 3.0.205)
Hi,
I have a problem with the creation of a 1-1 chat using SBDGroupChannel.createChannel.
func openChat(userId: String) {
SBDGroupChannel.createChannel(withUserIds: [userId], isDistinct: true, completionHandler: { [weak self] (groupChannel, error) in
guard error == nil else {
Alert.i.alertOnTopViewController(message: error.debugDescription, style: .alert)
return
}
if let channelUrl = groupChannel?.channelUrl {
// Open the chat
self?.showChannel(channelUrl: channelUrl)
}
})
}
func showChannel(channelUrl: String) {
SendBirdUtils.i.setCustomTheme() // Changes the theme
let channelVC = MySBUChannelViewController(channelUrl: channelUrl)
let naviVC = NavBarWithLightStatusBarStyle(rootViewController: channelVC)
naviVC.modalPresentationStyle = .fullScreen
(self.parent as? JobsVC)?.present(naviVC, animated: true)
}
When the chat doesn’t exist and I call the func openChat(…) the chat is created but the user nickname groupChannel?.getMember(userId)?.nickname is nil even if a send a message to him.
The nickname acquires value when the other user responds to me and after I close and reopen the app. I don’t understand what I’m doing wrong, if you have any advice please tell me.
Thanks AP