- Android
- iOS
- JavaScript
- Flutter
- ReactNative
- HarmonyOS
Not supported.
Not supported.
Not supported.
Get values for specified chatroom attributes. Call this after joining the chatroom successfully; the SDK returns empty data if the chatroom has not been joined.
Parameters
| Name | Type | Required | Default | Description | Version |
|---|---|---|---|---|---|
| chatroom | Object | Yes | None | Chatroom object. | 1.6.0 |
| chatroom.id | String | Yes | None | Chatroom ID. | 1.6.0 |
| chatroom.attributes | Array | Yes | None | Chatroom attribute list. See the example for the data structure. | 1.6.0 |
Callback
| Property | Type | Description | Version |
|---|---|---|---|
| chatroom | Object | Conversation object. | 1.6.0 |
| chatroom.id | String | Chatroom ID. | 1.6.0 |
| chatroom.attributes | Array | All chatroom attributes. See the example for the data structure. | 1.6.0 |
Example
let chatroom = {
id: 'chatroom1001',
attributes: [ { key: 'name' }, { key: 'age' }]
};
jim.getChatRoomAttributes(chatroom).then((chatroom) => {
let { id, attributes } = chatroom;
/*
attributes =>
[
{ key: 'name', value: 'xiaoshan' },
{ key: 'age', value: 18 },
]
*/
}, (error) => {
console.log('error', error)
});
Not supported.
Not supported.