types#
types#
- types
- "flooNotice" (res)
- "flooError" (res)
- "loginFail" (desc)
- "loginSuccess" (res)
- "onGroupListUpdate" (meta)
- "onGroupMemberChanged" (groupId)
- "onGroupMessage" (meta)
- "onInputStatusMessage" (res)
- "onMentionMessage" (meta)
- "onMessageCanceled" (res)
- "onMessageDeleted" (res)
- "onMessageRecalled" (res)
- "onMessageStatusChanged" (res)
- "onReceiveHistoryMsg" (res)
- "onRosterInfoUpdate" (res)
- "onRosterListUpdate" (meta)
- "onRosterApplied" (meta)
- "onRosterMessage" (meta)
- "onRosterRTCMessage" (meta)
- "onSendingMessageStatusChanged" (res)
- "onUnreadChange" (cid)
- "recentlistUpdate"
- "onGroupCreated" (meta)
- "onGroupDestoryed" (meta)
- "onGroupJoined" (meta)
- "onGroupLeaved" (meta)
- "onGroupKicked" (meta)
- "onGroupApplyAccepted" (meta)
- "onGroupApplyDeclined" (meta)
- "onGroupBaned" (meta)
- "onGroupUnbaned" (meta)
- "onRosterMessageContentAppend" (meta)
- "onGroupMessageContentAppend" (meta)
- "onRosterMessageReplace" (meta)
- "onGroupMessageReplace" (meta)
- ~RosterItem :
object - ~UserSettings :
object - ~UserProfile :
object - ~Meta :
object - ~RosterApplication :
object - ~GroupInfoAndSettings :
object - ~BriefGroupInfoAndSettings :
object - ~GroupMember :
object - ~GroupMemberBanned :
object - ~GroupUserRelationResponse :
object - ~GroupAnnouncement :
object - ~GroupInfoRequest :
object - ~GroupBannedMemberRequest :
object - ~GroupBlockedListItem :
object - ~GroupInvitation :
object - ~GroupApplication :
object - ~GroupSharedFile :
object - ~GroupSharedFileResponse :
object - ~GroupBanAllResponse :
object - ~FileUpload :
object - ~FileUploadResult :
object - ~fileUploadProgress :
function - ~ConversationItem :
object - ~UserProfile :
object - ~UserSettings :
object - ~Event :
string - ~EventCallback :
function
"flooNotice" (res)#
Floo notification
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | Results |
| res.category | string | Types |
| res.desc | string | Description |
Example
{category: 'loginMessage',desc: 'socket connecting...'} // Start connecting
{category: 'loginMessage',desc: 'socket connect success...'} // Connected
{category: 'loginMessage',desc: 'logining socket service...'} // Start logging in
{category: 'loginMessage',desc: 'login socket failure ......'} // Login failed
{category: 'loginMessage',desc: 'login socket success.....'} // Login succeeded
{category: 'loginMessage', desc: 'getting token...' } //Get token
{category: 'loginMessage',desc: 'token sucecc, getting roster lists..'} // Getting token succeeded, start to fetch friend list
{category: 'loginMessage',desc: 'get roster list failure:' + ex.message} // Friend list fetching failed
{category: 'action', desc: 'relogin' } // Need to automatically login
{category: 'action', desc: 'relogin_manually' } // Need to manually login
{category: 'conversation_deleted',desc: { id, source:'user_operation' }} // Conversation deleted. id: conversation ID; source: origin
{category: 'userNotice', desc:'PASSWORD_CHANGED'} // User password changed
{category: 'userNotice', desc:'FROZEN'} // User account frozen
{category: 'userNotice', desc:'REMOVED'} // User removed
{category: 'userNotice', desc:'KICK_BY_SAME_DEVICE'} // Signed out by another session on the same device
{category: 'userNotice', desc:'KICKED_BY_OTHER_DEVICE'} // Signed out by a session on another device
{category: 'userNotice', desc:'INFO_UPDATED'} // User information changed:profile or setting
{category: 'userNotice', desc:'DEVICE_LOGIN'} // User's other device logged-in
{category: 'userNotice', desc:'DEVICE_LOGOUT'} // User's other device logged-out
{category: 'userNotice', desc:'DEVICE_ADDED'} // New device notified
{category: 'userNotice', desc:'DEVICE_REMOVED'} // Device removal notified
{category: 'userNotice', desc:'CLUSTER_CHANGED'} // The user's cluster changed; sign in again"flooError" (res)#
FlooError
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.category | string | Types |
| res.desc | string | Description |
Example
{category: 'USER_BANNED', desc:'User is banned'}
{category: 'USER_FROZEN', desc:'User is frozen, please contact App Admin.'}
{category: 'APP_FROZEN', desc:'APP is frozen, please login Lanying IM Console for more details.'}
{category: 'LICENSE', desc:'Invalid LICENSE. Check that the service subscription is current.'}
{category: 'LICENSE', desc:'LICENSE user limit exceeded. Upgrade the service plan.'}
{category: 'DNS_FAILED', desc: dnsServer } // DNS error: server unreachable"loginFail" (desc)#
Login failed
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| desc | string | Cause of failure |
"loginSuccess" (res)#
Login successful
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | Empty object |
"onGroupListUpdate" (meta)#
Group list updated
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | undefined | Notification message content |
"onGroupMemberChanged" (groupId)#
Group member list updated
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| groupId | number | GroupID |
"onGroupMessage" (meta)#
Group message received
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content |
"onInputStatusMessage" (res)#
The other party is typing
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.ext | string | Extension data |
| res.from | string | Sender's user ID |
| res.to | string | Receiver's user ID |
"onMentionMessage" (meta)#
Group @message received
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content |
"onMessageCanceled" (res)#
Message is re-unread
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.uid | string | SessionID |
| res.mid | string | MessageID |
"onMessageDeleted" (res)#
MessageDeleted
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.uid | string | SessionID |
| res.mid | string | MessageID |
"onMessageRecalled" (res)#
Message is withdrawn
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.uid | string | SessionID |
| res.mid | string | MessageID |
"onMessageStatusChanged" (res)#
Message status changed: withdrawn/deleted/read
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.uid | string | SessionID |
| res.mid | string | MessageID |
"onReceiveHistoryMsg" (res)#
Message history received
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.next | number | The key to get message history next time |
"onRosterInfoUpdate" (res)#
Friend info changed
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| res | object | |
| res.rosterIds | Array.<number> | Friend's user ID list |
"onRosterListUpdate" (meta)#
Friend list changed
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of friend's notification |
"onRosterApplied" (meta)#
Friend application received
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of friend's application |
"onRosterMessage" (meta)#
Single chat message received
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content |
"onRosterRTCMessage" (meta)#
Received a one-to-one voice & video message
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content |
"onSendingMessageStatusChanged" (res)#
Message sending status changed
Kind: event emitted by types
| Param | Type | Description | ||
|---|---|---|---|---|
| res | object | |||
| res.status: | number | Sending status, can be valued as sending | failed | sent |
| res.mid: | number | client_mid generated by client |
"onUnreadChange" (cid)#
Unread count changed
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| cid | number | SessionID |
"recentlistUpdate"#
Latest conversation updated
Kind: event emitted by types
"onGroupCreated" (meta)#
Group creation notification
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupDestoryed" (meta)#
Group dismissal notification
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupJoined" (meta)#
Member joining application notification
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupLeaved" (meta)#
Group member left notification
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupKicked" (meta)#
Group member removed notification
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupApplyAccepted" (meta)#
Group joining application approved
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupApplyDeclined" (meta)#
Group joining application rejected
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupBaned" (meta)#
Banned in group
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onGroupUnbaned" (meta)#
Unbanned in group
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Message content of group notification |
"onRosterMessageContentAppend" (meta)#
Received appended content for a one-to-one message
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | One-to-one message whose content was appended |
"onGroupMessageContentAppend" (meta)#
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Group message whose content was replaced |
"onRosterMessageReplace" (meta)#
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | One-to-one message whose content was replaced |
"onGroupMessageReplace" (meta)#
Kind: event emitted by types
| Param | Type | Description |
|---|---|---|
| meta | Meta | Group message whose content was replaced |
types~RosterItem : object#
Friend info
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| alias | string | Alias |
| auth_mode | number | Verification method: 0 - No verification, anyone can be added as a friend; 1 - consent is required to be added as a friend; 2 - answer questions correctly to be added as a friend; 3 - reject all adding friend requests,int32 |
| auth_question | string | Verification question |
| avatar | string | Avatar |
| description | string | Description |
| ext | string | Extension information |
| mute_notification | boolean | Whether to receive message notifications |
| nick_name | string | Nickname or name |
| public_info | string | Public information, visible to both friends and strangers |
| relation | number | Relationships: 0 - Friend, 1 - Deleted, 2 - Stranger, int32 |
| user_id | number | Friend user ID,int64 |
| username | string | Username |
types~UserSettings : object#
User settings information
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| auth_answer | string | Answer of verification question |
| auth_mode | number | Verification method: 0 - No verification, anyone can be added as a friend; 1 - consent is required to be added as a friend; 2 - answer questions correctly to be added as a friend; 3 - reject all adding friend requests,int32 |
| auth_question | string | Verification question |
| auto_download | boolean | Whether to download automatically |
| group_confirm | boolean | Whether user consent is required when inviting to join group: true - user consent is required, false - invitation is automatically agreed |
| id | number | User ID, int64 |
| no_push | boolean | Whether to turn off push |
| no_push_detail | boolean | Whether to push details |
| no_push_end_hour | number | Start of push no-disturb time,int32 |
| no_push_start_hour | number | End of push no-disturb time,int32 |
| no_sounds | boolean | Whether to mute when message received |
| push_nick_name | string | Push display name |
| push_token | string | Push token |
| silence_end_time | number | End of push no-reminder time,int32 |
| silence_start_time | number | Start of push no-reminder time,int32 |
| user_id | number | User ID,int64 |
| vibratory | boolean | Whether to vibrate when message received |
types~UserProfile : object#
User information
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| avatar | string | Avatar url |
| description | string | Description |
string | ||
| mobile | string | Mobile number |
| nick_name | string | Nickname |
| private_info | string | Private information, visible only to yourself |
| public_info | string | Public information, visible to both friends and strangers |
| user_id | number | User ID,int64 |
| username | string | Username |
types~Meta : object#
Message body
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| id | string | MessageID |
| from | string | Sender |
| to | string | Receiver |
| content | string | Message content |
| type | string | Message types: text, image, audio, video, file, location, command, forward |
| ext | string | object | Extension data |
| config | string | object | SDKExtension field |
| attach | string | object | Attachment info |
| status | number | Message status: 0 - Unread, 1 - Delivered, 2 - Read |
| timestamp | string | Message delivery timestamp (milliseconds) |
| toType | string | Receiver types: roster - friend, group - group |
types~RosterApplication : object#
List entries of adding friend request
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| expired_time | number | Expiration time,int64 |
| reason | string | Request description |
| status | number | Status: 0 - Awaiting confirmation, 1 - Approved, 2 - Rejected int32 |
| user_id | number | User ID that initiate adding friend,int64 |
types~GroupInfoAndSettings : object#
Group info
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| apply_approval | number | Group membership application settings, 0: Agree all requests 1: Need to confirm by Admin 2: Reject all requests |
| avatar | string | Group avatar |
| ban_expire_time | number | Expiration time (second), during which only Admins are allowed to send messages, 0 or less than the current time means no banning, -1 means banned permanently |
| created_at | number | Creation time |
| description | string | Group description |
| ext | string | Group extension information |
| group_id | number | Group id,int64 |
| history_visible | boolean | History chat visibility settings for new members |
| member_invite | boolean | Group member invite settings: false - do not allow invitations, true - allow invitations (default) |
| member_modify | boolean | Group members modify group info settings: false - group members can't modify group info (default), true - group members can modify group info |
| msg_mute_mode | number | Group message blocking mode: 0 - no blocking, 1 - blocking local message notifications, 2 - blocking all, means not receiving messages |
| msg_push_mode | number | Group message push mode: 0 - receive all pushes, 1 - block all pushes, 2 - receive admin and @message pushes, 3 - receive admin message pushes only, 4 - receive @message pushes only |
| name | string | Group name |
| owner_id | number | Group Owner id,int64 |
| read_ack | boolean | Group message read function settings |
| status | number | Group state, 0: normal, 1: dissolved |
| type | number | Group types: 1 - public group, 0 - private group, 2 - chatroom |
| updated_at | number | Update time,int64 |
| count | number | Number of group members |
| capacity | number | GroupCapacity |
types~BriefGroupInfoAndSettings : object#
Group profile and user settings
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| apply_approval | number | Group membership application settings, 0: Agree all requests 1: Need to confirm by Admin 2: Reject all requests |
| avatar | string | Group avatar |
| capacity | number | GroupCapacity |
| count | number | Number of group members |
| group_id | number | Group id,int64 |
| msg_mute_mode | number | Group message blocking mode: 0 - no blocking, 1 - blocking local message notifications, 2 - blocking all, means not receiving messages |
| msg_push_mode | number | Group message push mode: 0 - receive all pushes, 1 - block all pushes, 2 - receive admin and @message pushes, 3 - receive admin message pushes only, 4 - receive @message pushes only |
| name | string | Group name |
| owner | number | Group Owner id,int64 |
| status | number | Group state, 0: normal, 1: dissolved,int32 |
| type | number | Group types: 1 - public group, 0 - private group, 2 - chatroom.int32 |
types~GroupMember : object#
Group member format
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| display_name | string | Group member profile |
| join_time | number | Member join time,int64 |
| user_id | number | User id,int64 |
| avatar | string | AvatarAddress |
types~GroupMemberBanned : object#
Banned members
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| display_name | string | Group member profile |
| join_time | number | Member join time,int64 |
| user_id | number | User id,int64 |
| avatar | string | AvatarAddress |
| expired_time | number | BanExpiration time |
types~GroupUserRelationResponse : object#
Group user's request result
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| reason | string | Reason |
| result | string | Results |
| user_id | number | User ID,int64 |
types~GroupAnnouncement : object#
GroupAnnouncement content
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| author | number | Announcement publisher,int64 |
| content | string | Announcement content |
| created_at | number | Announcement publish time,int64 |
| group_id | number | Group id,int64 |
| id | number | Announcement id,int64 |
| title | string | Announcement tittle |
types~GroupInfoRequest : object#
Create group
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| avatar | string | Group avatar |
| description | string | Group description |
| name | string | Group name |
| type | number | Group type: 1 for public group, 0 for private group, 2 for chatroom,int32 |
| user_list | Array.<number> | List of user ids invited to join group |
types~GroupBannedMemberRequest : object#
Ban request
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| duration | number | Duration of banned in minutes,int64 |
| group_id | number | Group id,int64 |
| user_list | Array.<number> | User id list |
types~GroupBlockedListItem : object#
Group blacklist
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| user_id | number | User id,int64 |
| group_id | number | Group id,int64 |
| create_at | string | Creation time |
types~GroupInvitation : object#
Group invitation info
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| group_id | number | GroupID |
| inviter_id | number | Inviter ID |
| invitee_id | number | Invitee ID |
| reason | string | Reason |
| status | number | Status: 0 - Pending, 1 - User agreed, 2 - User rejected |
| expire_time | number | Expiration time |
| create_at | string | Creation time |
types~GroupApplication : object#
GroupMembership application information
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| group_id | number | GroupID |
| applicant_id | number | Applicant ID |
| reason | string | Reason |
| expire_time | number | Expiration time |
| status | number | Status: 0 - Pending, 1 - Agreed, 2 - Rejected |
types~GroupSharedFile : object#
Returned format of group shared files
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| created_at | number | int64 |
| file_id | number | Shared file id,int64 |
| group_id | number | Group id,int64 |
| name | string | Shared file name |
| size | number | Shared file size,int64 |
| type | string | Shared file type |
| updated_at | number | int64 |
| uploader | number | Shared file uploader,int64 |
| url | string | Shared file url |
types~GroupSharedFileResponse : object#
Result of group shared files deletion
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| file_id | number | FileID |
| reason | string | Reason |
| result | string | Results |
types~GroupBanAllResponse : object#
Result of banning all members
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| ban_expire_time | number | Expiration time of banning all members,int64 |
types~FileUpload : object#
File uploading info
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| download_url | string | Download address |
| oss_body_param | object.<string, string> | Additional parameters |
| upload_url | string | Upload address |
types~FileUploadResult : object#
File uploading result
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| url | string | Download address |
types~fileUploadProgress : function#
FileUpload progressCallback
Kind: inner typedef of types
| Param | Type | Description |
|---|---|---|
| res | object | Progress |
| res.loaded | number | Downloaded bytes |
| res.total | number | Total bytes |
types~ConversationItem : object#
Conversation info
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| id | number | SessionID |
| content | string | Message content |
| timestamp | string | Message delivery timestamp (milliseconds) |
| type | string | Session type: roster - Single chat, group - Group chat |
types~UserProfile : object#
User information
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| avatar | string | Avatar url |
| description | string | Description |
string | ||
| mobile | string | Mobile number |
| nick_name | string | Nickname |
| private_info | string | Private information, visible only to yourself |
| public_info | string | Public information, visible to both friends and strangers |
| user_id | number | User ID,int64 |
| username | string | Username |
types~UserSettings : object#
User settings information
Kind: inner typedef of types
Properties
| Name | Type | Description |
|---|---|---|
| auth_answer | string | Answer of verification question |
| auth_mode | number | Verification method: 0 - No verification, anyone can be added as a friend; 1 - consent is required to be added as a friend; 2 - answer questions correctly to be added as a friend; 3 - reject all adding friend requests,int32 |
| auth_question | string | Verification question |
| auto_download | boolean | Whether to download automatically |
| group_confirm | boolean | Whether user consent is required when inviting to join group: true - user consent is required, false - invitation is automatically agreed |
| id | number | Set ID |
| no_push | boolean | Whether to turn off push |
| no_push_detail | boolean | Whether to push details |
| no_push_end_hour | number | Start of push no-disturb time,int32 |
| no_push_start_hour | number | End of push no-disturb time,int32 |
| no_sounds | boolean | Whether to mute when message received |
| push_nick_name | string | Push display name |
| push_token | string | Push token |
| silence_end_time | number | End of push no-reminder time,int32 |
| silence_start_time | number | Start of push no-reminder time,int32 |
| user_id | number | User ID,int64 |
| vibratory | boolean | Whether to vibrate when message received |
types~Event : string#
Listening event name
Kind: inner typedef of types
types~EventCallback : function#
Listening event callback
Kind: inner typedef of types
| Param | Type | Description |
|---|---|---|
| res | flooNotice | flooError | loginFail | loginSuccess | onGroupListUpdate | onGroupMemberChanged | onGroupMessage | onInputStatusMessage | onMentionMessage | onMessageCanceled | onMessageDeleted | onMessageRecalled | onMessageStatusChanged | onReceiveHistoryMsg | onRosterInfoUpdate | onRosterListUpdate | onRosterMessage | onRosterRTCMessage | onSendingMessageStatusChanged | onUnreadChange | recentlistUpdate | onGroupCreated | onGroupDestoryed | onGroupJoined | onGroupApplyAccepted | onGroupApplyDeclined | onGroupBaned | onGroupUnbaned | onRosterMessageContentAppend | onGroupMessageContentAppend | onRosterMessageReplace | onGroupMessageReplace | Event result |