Chatting APi
プロジェクトを開始する前に、チャット機能を使用して簡単なチャットアプリケーションを作成し、事前サンプリングを行いました.
Mac OS with developer mode enabled Xcode At least one device running iOS 9.0 and later Swift 4.0 and later Objective-C アプリケーションを作成する前に、上記の要件を満たす必要があります.
https://dashboard.sendbird.com/名のWebサイトにアプリケーションを登録し、APP IDを取得してから使用する必要があります.
そしてcocapod
上のアプリケーションIDをコピーしてAppDelegateに書き込む必要があります.
タブバーのメッセージをクリックすると、SUChannelListViewControlが表示され、UIを別途指定することなく、上記のUIを使用できます.
RightBarButtonをクリックして新しいチャットを作成する画面に入ります!
チャットウィンドウを作成して、会話を行い、再びChannelListViewにアクセスすると、以下のようにチャットしている部屋が表示されます.
多くの組み込み機能が含まれていますが、通常はカスタマイズされているので、SendBirdUIキットをチェックして上書きし、直接カスタマイズする必要があります.
https://sendbird.com/docs/chat/v3/ios/quickstart/send-first-message
上のページを参考に作成!
Requirement
Before start
https://dashboard.sendbird.com/名のWebサイトにアプリケーションを登録し、APP IDを取得してから使用する必要があります.
そしてcocapod
pod 'SendBirdUIKit'
podを追加してインストールする必要があります!Iniialize with APP_ID

上のアプリケーションIDをコピーしてAppDelegateに書き込む必要があります.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let APP_ID = "FCE91D92-1611-4134-BAC5-A3A0D5377CBD"
// Specify your Sendbird application ID.
SBUMain.initialize(applicationId: APP_ID) {
// DB migration has started.
} completionHandler: { error in
// If DB migration is successful, proceed to the next step.
// If DB migration fails, an error exists.
}
return true
}
APP ID、SBMUMainを作成します.initializeを作成する必要があります// Initialize a SBDMain instance to use APIs in the client app.
SBDMain.initWithApplicationId(APP_ID, useCaching: false) {
} completionHandler: { error in
}
usecachingパラメータは、appがlocalstorageをチャットに使用するかどうかを決定し、localcachingを使用する場合はTrueに設定できます.MainTapBarController()
let channelListVC = ChatViewController()
let naviVC = UINavigationController(rootViewController: channelListVC)
naviVC.tabBarItem.image = UIImage(systemName: "message")
ChatViewController()
import SendBirdUIKit
class ChatViewController: SBUChannelListViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}

タブバーのメッセージをクリックすると、SUChannelListViewControlが表示され、UIを別途指定することなく、上記のUIを使用できます.
RightBarButtonをクリックして新しいチャットを作成する画面に入ります!

/// This is a function that shows the channel creation viewController with channel type.
///
/// If you want to use a custom createChannelViewController, override it and implement it.
/// - Parameter type: Using the Specified Type in CreateChannelViewController (default: `.group`)
@objc open func showCreateChannel(type: SendBirdUIKit.ChannelType = .group)
チャットするユーザーを選択してCREATEボタンを押すと、チャットが作成されます.
チャットウィンドウを作成して、会話を行い、再びChannelListViewにアクセスすると、以下のようにチャットしている部屋が表示されます.

多くの組み込み機能が含まれていますが、通常はカスタマイズされているので、SendBirdUIキットをチェックして上書きし、直接カスタマイズする必要があります.
https://sendbird.com/docs/chat/v3/ios/quickstart/send-first-message
上のページを参考に作成!
Reference
この問題について(Chatting APi), 我々は、より多くの情報をここで見つけました https://velog.io/@doyun/Chatting-APiテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol