# 会话
# 获取会话信息
# 使用说明
此 api 设计上是用来选择临时会话的,但是目前 yach 没有临时会话的概念,所以目前和根据 corpid 选择会话功能一致,建议用其代替
| Android | iOS | PC | 
|---|---|---|
| 支持 | 支持 | 不支持 | 
yy.biz.chat.pickConversation({
  corpId: "xxx", //企业id,必须是用户所属的企业的corpid
  isConfirm: true, //是否弹确认框
  multiple: true, // 是否支持多选,默认false
  limitTips: "超出了", //超过限定会话提示
  maxConversations: 100, //最大选择会话数量
  onSuccess: function() {
    //onSuccess将在选择结束之后调用
    /*[{
            cid: 'xxxx',
            title:'xxx',
            type:0,
        },{
            cid: 'xxxx',
            title:'xxx',
            type:1,
        }]*/
  },
  onFail: function() {}
});
 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 参数说明
| 参数 | 参数类型 | 说明 | 
|---|---|---|
| corpId | String | 企业 ID | 
| isConfirm | Boolean | 是否弹出确认窗口,默认为 true | 
| multiple | Boolean | 是否支持多选,默认单选 | 
| limitTips | String | 超过限定会话提示 | 
| maxConversations | Number | 最大选择会话数量 | 
# 返回说明
返回一个数组,数组内包裹对象
| 参数 | 说明 | 
|---|---|
| cid | 会话 id | 
| title | 会话标题 | 
| type | 会话类型(单聊:0;群聊:1) | 
# 
根据 corpid 选择会话
  # 使用说明
| Android | iOS | PC | 
|---|---|---|
| 支持 | 支持 | 支持 | 
yy.biz.chat.chooseConversationByCorpId({
  corpId: "xxx", ////企业id,必须是用户所属的企业的corpid
  isAllowCreateGroup: false,
  filterNotOwnerGroup: false,
  multiple: true, // 是否支持多选,默认false
  limitTips: "超出了", //超过限定会话提示
  maxConversations: 100, //最大选择会话数量
  onSuccess: function() {
    //onSuccess将在选择结束之后调用
    /*[{
            chatId: 'xxxx',
            title:'xxx',
            type:0,
        },{
            chatId: 'xxxx',
            title:'xxx',
            type:0,
        }]*/
  },
  onFail: function() {}
});
 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 参数说明
| 参数 | 参数类型 | 说明 | 
|---|---|---|
| corpId | String | 企业 ID | 
| multiple | Boolean | 是否支持多选,默认单选 | 
| limitTips | String | 超过限定会话提示 | 
| maxConversations | Number | 最大选择会话数量 | 
| isAllowCreateGroup | Boolean | 是否允许创建会话 | 
| filterNotOwnerGroup | Boolean | 是否限制为自己创建的会话 | 
# 返回说明
返回一个数组,数组内包裹对象
| 参数 | 说明 | 
|---|---|
| chatId | 会话 id | 
| title | 会话标题 | 
| type | 会话类型(单聊:0;群聊:1) |