gpt4 book ai didi

ios - 在 Sendbird IOS 中创建一对一聊天

转载 作者:搜寻专家 更新时间:2023-11-01 07:17:48 25 4
gpt4 key购买 nike

我正在尝试使用 SendBirdSDK 创建一个聊天应用程序.但是我在文档中找不到任何方法来开始与用户聊天。我下载了示例项目并检查了它,但它只包含组 channel 和开放 channel 。

是否有任何此类方法可以创建一对一消息,或者我是否需要创建一个 groupchat只有一个用户 ID?

我们将不胜感激

最佳答案

根据文档,

A Group Channel is a private chat. A user may join the chat only through an invitation by another user who is already a member of the chatroom. A Group Channel can consist of one to hundreds of members. Creating a channel with two members allows 1-to-1 messaging.

因此,您只需创建一个具有两个用户 ID 的群组 channel ,就可以进行一对一的聊天。此外,您应该启用 Distinct 属性,因为也根据文档:

Consequently, we recommend that you enable the Distinct property in 1-to-1 messaging channels in order to reuse the same channel when a user chooses to directly message a friend. If the property is disabled, the user will create a new channel even if they have had previous conversations with the friend, and therefore will not be able to see or access previously sent messages or data.

引用:https://docs.sendbird.com/ios#group_channel_3_creating_a_group_channel

关于ios - 在 Sendbird IOS 中创建一对一聊天,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41058430/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com