I am creating a new group channel and try to upload the cover image and passing the image data but when I have tried to fetch that group channel but image is missing. I have tried this by using UIKit SDK also but unable to update the image also.
Hi @patelvivek9115 Could you tell me SDK version you are using? and it would be helpful if you show me how to use sdk to upload image. Thanks
Its the latest one 1.2.5 SendBirdUIKit
Would you mind to show some code snippet so that I can understand your situation more precisely?
Sure I can share but I am also doing it from the UIKit sdk and on that I don’t have any control
let params = SBDGroupChannelParams()
if let groupImage = groupImage {
params.coverImage = groupImage.jpegData(compressionQuality: 1.0)
}
params.add(self.users)
params.name = roomName
params.isDistinct = false
SBDGroupChannel.createChannel(with: params) { (channel, error) in
if let error = error {
NetworkController.hideHUD()
let alertController = UIAlertController(title: "Error", message: error.domain, preferredStyle: .alert)
let actionCancel = UIAlertAction(title: "Close", style: .cancel, handler: nil)
alertController.addAction(actionCancel)
DispatchQueue.main.async {
self.present(alertController, animated: true, completion: nil)
}
return
}
}
And are you saying that channel from callback SBDGroupChannel.createChannel(with: params) { (channel, error) in
does not contain coverUrl
?
Not in this call back when I am fetching list of the channel
self.channelListQuery?.loadNextPage(completionHandler: { (channels, error) in
NetworkController.hideHUD()
if error != nil {
DispatchQueue.main.async {
self.refreshControl.endRefreshing()
}
return
}
DispatchQueue.main.async {
if refresh {
self.channels.removeAll()
}
self.channels += channels!
self.tableView.reloadData()
self.refreshControl.endRefreshing()
}
})
Alright, so in the creation callback, there is coverUrl in the group channel right? but not when you use channelListQuery ?
Could you provide a log in creation callback and channelListQuery results? I just tested
- create a group channel with setting
coverImage
- fetch channel from channelListQuery and see if coverUrl is existed in that channel
But I cannot find any abnormal behavior.
@patelvivek9115 There was a bug in chat sdk. We will going to release patch version this week. Thanks for your patience!
Fixed version was release. Would you update SendbirdSDK and see if that fixes your problem?