Remove the SBD prefix across names for all constants, protocols, classes, enums, and type definitions.
Rename the main class from SBDMain to SendbirdChat.
Creation of Sendbird instances is no longer available in v4.
Rename SBDError to SBError.
Add didConnect(userId:) and didDisconnect(userId:) to ConnectionDelegate.
Split SBDChannelDelegate into BaseChannelDelegate, GroupChannelDelegate, and OpenChannelDelegate.
Remove SBDUserListQuery. Use specific queries such as ApplicationUserListQuery and BlockedUserListQuery to query users instead.
Add the requestId to the file onProgress interface. Change interface FileMessagesWithProgressHandler and fun onProgress(bytesSent: Int, totalBytesSent: Int, totalBytesToSend: Int) to fun onProgress(requestId: String, bytesSent: Int, totalBytesSent: Int, totalBytesToSend: Int)
Separate existing params such as SBDUserMessageParams into UserMessageCreateParams and UserMessageUpdateParams.
The default value of the GroupChannel class’s members property has been changed from nil to [].
The default value of the User class’s nickname property has been changed from nil to "".
Remove SBDConnectionManager, which was deprecated in v3.
Local caching in the SDK v4 can facilitate caching-related functionalities and more. SyncManager will soon be deprecated, so we highly recommend using local caching instead.
Remove setters for Query classes and add corresponding Params classes.
Mappable protocol is no longer supported. Instead, use Swift's Codable to serialize and deserialize objects. It stays the same for Objective-C.
The following is a step-by-step guide which covers the changes and key steps required when migrating from the Chat SDK v3 to v4.
Sendbird Chat SDK v4 will likely prevent your app from compiling until all migration tasks are complete and all errors are fixed. After fixing all the blocking errors, further work may be needed to remove warnings and re-align the SDK with your app. We recommend you allow a generous timeline for the task. Depending on the level of dependency, it may take a few hours to a week.
It's recommended to remove any deprecated methods from the Chat SDK v3 since v4 will likely have a long list of errors. Find and replace all instances of import SendBirdSDK with import SendbirdChatSDK. Notice that the "b" in Sendbird is now lowercase.
SBDChannelDelegate is split into BaseChannelDelegate, GroupChannelDelegate, and OpenChannelDelegate. Therefore, the previous channel delegate needs to be changed and may throw the following error in Xcode.
Cannot find type ChannelDelegate in scope.
In this case, the suggested fix is to consider the context of the class to determine which delegate is required. For example, AppDelegate likely requires BaseChannelDelegate instead of the original SBDChannelDelegate.
In v4, some of the param classes have been separated and renamed. For example, GroupChannelParams was split into GroupChannelCreateParams or GroupChannelUpdateParams. Thus, the following error may be seen in Xcode.
Cannot find type XXXParams in scope.
In this case, the suggested fix is to use Xcode's autocomplete, or refer to Sendbird Docs to find relevant name changes.
In v3, casting MutedUserListQuery, BannedUserListQuery, and ParticipantListQuery to UserListQuery was possible.
In v4, the changes made to the query model no longer works in the same pattern as in v3. UserListQuery has changed to ApplicationUserListQuery and each query type must be declared individually.
private var userListQuery: UserListQuery?
if self.userListQuery == nil {
switch userListType {
case .banned:
self.userListQuery = channel.createBannedUserListQuery { $0.limit = 20 }
case .muted:
self.userListQuery = channel.createMutedUserListQuery { $0.limit = 20 }
case .participant:
self.userListQuery = channel.createParticipantUserListQuery { $0.limit = 20 }
}
}
private var bannedUserListQuery: BannedUserListQuery?
private var mutedUserListQuery: MutedUserListQuery?
private var participantListQuery: ParticipantUserListQuery?
switch userListType {
case .banned:
self.bannedUserListQuery = channel.createBannedUserListQuery()
case .muted:
self.mutedUserListQuery = channel.createMutedUserListQuery()
case .participant:
self.participantUserListQuery = channel.createParticipantUserListQuery()
}