Using multiple devices in both iOS 15.3.1 and 14.8.1, In a group channel, I have noticed that messages are being marked as read even after dismissing the SBUChannelViewController. Only until the user connects to another channel or closes the app entirely will new messages not be instantly marked as read.
I’ve explored the deepest parts of the iOS SDK and UIKit framework documentation but was unable to find anything related to disconnecting, even force disconnecting from a chat; All I could find was leaving chats entirely and banning a user which isn’t exactly what I’m after.
I have not added any code to my app that relates to automating the reading/marking as read, I do have a class that is listening to the SBDChannelDelegate constantly but that isn’t doing anything more than notifying my managing containers to update themselves with the recent changes (assuming the group channel classes aren’t dynamic, haven’t seen code that said otherwise).
the channel delegate functionality is literally this:
extension GroupChannelsManager: SBDChannelDelegate {
func channelWasChanged(_ sender: SBDBaseChannel) {
addChannel(sender, withOverride: true)
}
func channelWasDeleted(_ channelUrl: String, channelType: SBDChannelType) {
if channelType == .group {
self.channels.removeAll { channel in
channel.channelUrl == channelUrl
}
}
}
func channelWasFrozen(_ sender: SBDBaseChannel) {
addChannel(sender, withOverride: true)
}
func channelWasUnfrozen(_ sender: SBDBaseChannel) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, createdMetaData: [String: String]?) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, updatedMetaData: [String: String]?) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, deletedMetaDataKeys: [String]?) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, createdMetaCounters: [String: NSNumber]?) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, updatedMetaCounters: [String: NSNumber]?) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, deletedMetaCountersKeys: [String]?) {
addChannel(sender, withOverride: true)
}
func channelWasHidden(_ sender: SBDGroupChannel) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDGroupChannel, didReceiveInvitation invitees: [SBDUser]?, inviter: SBDUser?) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDGroupChannel, didDeclineInvitation invitee: SBDUser, inviter: SBDUser?) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDGroupChannel, userDidJoin user: SBDUser) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDGroupChannel, userDidLeave user: SBDUser) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, userWasMuted user: SBDUser) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, userWasUnmuted user: SBDUser) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, userWasBanned user: SBDUser) {
addChannel(sender, withOverride: true)
}
func channel(_ sender: SBDBaseChannel, userWasUnbanned user: SBDUser) {
addChannel(sender, withOverride: true)
}
func channelDidChangeMemberCount(_ channels: [SBDGroupChannel]) {
addChannels(channels, withOverride: true)
}
}
Other than this class, and a generic facade class that manages interaction with the UIKit framework and SDK, there is nothing that I’ve written that would have changed the expected functionality.
Is there a secret function or something I’m not correctly calling? Seeing as we aren’t dismissing via the dismiss button provided by the UIKit (though I looked into the source code and my code underneath looks almost identical, but works with our app structure)