Skip to main content

Migration Guide: iOS Chat SDK (v1.7.1 to v1.8.0)

This guide provides an overview of the key changes in v1.8.0 of the LikeMinds chat iOS SDK and instructions for updating your project from v1.7.1 or below.


Key Updates

  1. Changes to LMCoreComponents
  • LMCoreComponents.shared.groupChatFeedScreen changed to LMCoreComponents.shared.communityChatScreen
  • LMCoreComponents.shared.chatFeedScreen changed to LMCoreComponents.shared.communityHybridChatScreen
  • LMCoreComponents.shared.dmChatFeedScreen changed to LMCoreComponents.shared.networkingChatScreen

Migration Steps

Step 1. Upgrade the LikeMindsChatCore package in podfile to the below version

platform :ios, '13.0'

target 'YourProjectName' do
use_frameworks!
pod 'LikeMindsChatCore', '~> 1.8.0'
end

Step 2: Install the updated pods

pod install 

Step 3: Update Chat Initialization Code

Replace your existing chat initialization code with one of the new theme-specific implementations:

import LikeMindsChatCore

let username = "USER_NAME"
let uuid = "USER_UUID"
let apiKey = "YOUR API KEY"

try? LMChatCore.shared.showChat(apiKey: apiKey, username: username, userId: userId) { [weak self] result in
switch result {
case .success:
do {
let chatFeedVC = try LMCommunityChatViewModel.createModule()
self?.navigationController?.pushViewController(chatFeedVC, animated: true)
} catch {
let alert = UIAlertController(
title: "Error",
message: "Failed to open chat: \(error.localizedDescription)",
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "OK", style: .default))
self?.present(alert, animated: true)
}
case .failure(let error):
let alert = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: .alert)
alert.addAction(.init(title: "OK", style: .default))
self?.present(alert, animated: true)
return
}
}

Step 4: Update LMCoreComponents References

Replace all instances of the old component names with the new ones:

// Old
LMCoreComponents.shared.groupChatFeedScreen

// New
LMCoreComponents.shared.communityChatScreen

By following these steps, you can migrate seamlessly to v1.8.0 and take advantage newly introduced features and customizations.