Description of class and constant definitions

Update time: 2021/08/20 11:01:57

Description of class and constant definitions

NIMSDKLogLevel

Enumeration definition Value Description
kNIMSDKLogLevelFatal 1 SDK Fatal Log
kNIMSDKLogLevelError 2 SDK Error Log
kNIMSDKLogLevelWarn 3 SDK Warn Log
kNIMSDKLogLevelApp 4 SDK App Level Log, which can be used for streamlining the SDK log upon official SDK release
kNIMSDKLogLevelPro 5 SDK debugging log, which is more detailed and more suitable for development debugging

File:nim_global_def.h

NIMProxyType

Enumeration definition Value Description
kNIMProxyNone 0 No proxy
kNIMProxyHttp11 1 HTTP 1.1 Proxy (not supported for now)
kNIMProxySocks4 2 Socks4 Proxy
kNIMProxySocks4a 3 Socks4a Proxy
kNIMProxySocks5 4 Socks5 Proxy

File:nim_global_def.h

NIMLogoutType

Enumeration definition Value Description
kNIMLogoutChangeAccout 1 Logout/switch account (return to login interface)
kNIMLogoutKickout 2 Kicked-out (return to login interface)
kNIMLogoutAppExit 3 Exit app
kNIMLogoutRelogin 4 Re-login operation, including re-login after pseudo-login upon app start with saved password, and that after disconnection (no account change)

File:nim_client_def.h

NIMIMMessage

Member/method Type Read-only Description
Serialize() - - Serialization method
SessionType enum N Session type
SenderID string Y Sender ID, filled out by server, which the sender may ignore
ReceiverID string N Receiver ID, which should be your own id when sending a message to yourself
SenderClientType enum Y Sender client type, filled out by server, which the sender may ignore
SenderDeviceId string Y Sender device id, filled out by server, which the sender may ignore
SenderNickname string Y Sender nickname, filled out by server, which the sender may ignore
TimeStamp int64 N Message timestamp (milliseconds)
MessageType enum N Message type
ClientMsgID string N Message ID (client)
ServerMsgId string Y Sever message id
ResendFlag int N Flag bit for message resend, 0 means the first time and 1 means resend
NeedCounting bool N (Optional) Whether counting is needed for push message (corner mark), set to True by default
ServerExtension string N Third-party extension field, with no limitation on format, but the length of which is limited to 1024
PushPayload JsonExtension N Custom push property, unformatted json string with a length of 2048
PushContent string N Custom push content, with a length not exceeding 200 bytes
NeedPush bool N (Optional) Whether push is needed, set to True by default
NeedPushNick bool N (Optional) Whether push messages need prefixes, set to True by default
ServerSaveHistory bool N (Optional) Whether to save messages record on server, set to True by default (optional)
Roaming bool N (Optional) Whether the message may be roamed, set to True by default (optional)
MultiSync bool N (Optional) Whether to enable multi-terminal sync for the message, set to True by default (optional)
Routable bool N (Optional) Whether the message is routable, follow router configuration by default
SavedOffline bool N (Optional) Whether to save the message locally, set to True by default
AntiSpamEnabled bool N (Optional) Whether to enable anti-spam of YiDun, set to false by default
AntiSpamContent string N (Optional) Anti-spam field customized by developer, length limit: 5000 characters, format: json string, {"type": 1: text, 2: image, 3 video, "data": "Text content or image address or video address"}
LocalFilePath string N Local absolute path of multimedia message resource, managed by SDK locally and required when sending multimedia messages
TalkID string N Session id, optional for sender. The receiver receives the sender id
ResourceId string N Session id, optional for sender. The receiver receives the client message id
MsgLogStatus enum N Message status:
MsgLogSubStatus enum N Message substatus
LocalExtension string N Local extension content

NIMMessageType

Enumeration definition Value Description
kNIMMessageTypeText 0 Text message
kNIMMessageTypeImage 1 Image message
kNIMMessageTypeAudio 2 Audio message
kNIMMessageTypeVideo 3 Short video type information
kNIMMessageTypeLocation 4 Location message
kNIMMessageTypeNotification 5 System notifications (including those for joining and exiting team, etc.)
kNIMMessageTypeFile 6 File message
kNIMMessageTypeTips 10 Reminder type message, content of which should be from the kNIMMsgKeyServerExt field in the message structure and filled in according to format requirements
kNIMMessageTypeRobot 11 Baud robot message
kNIMMessageTypeCustom 100 Custom message
kNIMMessageTypeUnknown 1000 Message type unknown, for local use, not for sending, serves as default value

File:nim_msglog_def.h

NIMSessionType

Enumeration definition Value Description
kNIMSessionTypeP2P 0 Individual, P2P
kNIMSessionTypeTeam 1 Team

File:nim_session_def.h

IMMessage

Member/method Type Read-only Description
ToJsonString (bool use_to_send) - - Serialization method
attach_ string N Message attachment
client_msg_id_ string N Message ID (client)
content_ string N Message content, with a length up to 5000
feature_ NIMMessageFeature Y Message feature
local_res_id_ string N Media file ID (client)
local_res_path_ string N Local absolute path of media file (client)
local_talk_id_ string N Session ID (client)
msg_setting_ MessageSetting N Message property settings
readonly_sender_client_type_ NIMClientType Y Sender's client type (read only)
readonly_sender_device_id_ string Y Sender's device id (read only)
readonly_sender_nickname_ string Y Sender's nickname (read only)
readonly_server_id_ int64 Y Session ID (server, read only)
receiver_accid_ string N Receiver ID
rescode_ NIMResCode Y Error code
sender_accid_ string Y Sender ID
session_type_ NIMSessionType N Session type
status_ NIMMsgLogStatus Y Message status (client)
sub_status_ NIMMsgLogSubStatus N Message substatus (client)
timetag_ int64 Y Message timestamp (milliseconds)
type_ NIMMessageType N Message type

File:nim_talk_helper.h

NIMMessageFeature

Enumeration definition Value Description
kNIMMessageFeatureDefault 0 Default
kNIMMessageFeatureLeaveMsg 1 Offline message
kNIMMessageFeatureRoamMsg 2 Roaming message
kNIMMessageFeatureSyncMsg 3 Sync message
kNIMMessageFeatureCustomizedMsg 4 Passthrough message

File:nim_msglog_def.h

NIMClientType

Enumeration definition Value Description
kNIMClientTypeDefault 0 Default
kNIMClientTypeAndroid 1 Android
kNIMClientTypeiOS 2 iOS
kNIMClientTypePCWindows 4 PC Windows
kNIMClientTypeWeb 16 Web
kNIMClientTypeRestAPI 32 RestAPI
kNIMClientTypeMacOS 64 Mac

File:nim_client_def.h

NIMMsgLogStatus

Enumeration definition Value Description
kNIMMsgLogStatusNone 0 Default, it's meaning is too varied and therefore can't be used as a query condition
kNIMMsgLogStatusUnread 1 Received, unread
kNIMMsgLogStatusRead 2 Received, read
kNIMMsgLogStatusDeleted 3 Deleted
kNIMMsgLogStatusSending 4 : The message is being sent.
kNIMMsgLogStatusSendFailed 5 : The message is not sent successfully
kNIMMsgLogStatusSent 6 Message sent
kNIMMsgLogStatusReceipt 7 The other party has read the content sent
kNIMMsgLogStatusDraft 8 Draft
kNIMMsgLogStatusSendCancel 9 Cancel send

File:nim_msglog_def.h

NIMMsgLogSubStatus

Enumeration definition Value Description
kNIMMsgLogSubStatusNone 0 Default
kNIMMsgLogSubStatusNotPlaying 20 Not played
kNIMMsgLogSubStatusPlayed 21 Played

File:nim_msglog_def.h

MessageSetting

Member/method Type Read-only Description
ToJsonValue (Json::Value &message) - - Assemble Json Value string
ParseMessageSetting (const Json::Value &message) - - Get message property settings by parsing Json Value
anti_spam_content_ string N (Optional) Developer-defined anti-spam field, with a length up to 5000
anti_spam_enable_ BoolStatus N Whether enable anti-spam of YiDun
force_push_content_ string N Text in force push team message
force_push_ids_list_ liststd::string N Force push team message list
is_force_push_ BoolStatus N Force push switch for team message, with total force push set as true and force push list set as empty
local_ext_ string N Local extension field, with no limitation on format, but the length up to 1024
need_offline_ BoolStatus N Whether tosupport offline messages
need_push_ BoolStatus N Determine if push is needed
push_content_ string N Custom push content, with a length not exceeding 200 bytes
push_need_badge_ BoolStatus N Whether message counting is needed
push_need_prefix_ BoolStatus N Determine prefix is needed for push message
push_payload_ Json::Value N Third-party defined push property, with a length of 2048
resend_flag_ BoolStatus N Whether the message is in a resent status
roaming_ BoolStatus N Whether the message may be roamed
routable_ BoolStatus N Whether the message is routable
self_sync_ BoolStatus N Whether the message may be synced by the sender with multiple terminals
server_ext_ Json::Value N Third-party extension field with a length limited to 1024
server_history_saved_ BoolStatus N Whether to save messages record on server

File:nim_talk_helper.h

Namespace:NIM

IMFile

Member/method Type Read-only Description
ToJsonString () - - Assemble Json Value string
ToJsonString (Json::Value &attach) - - Assemble Json Value string
display_name_ string N Used to display the file name
file_extension_ string N File extension
md5_ string N File content MD5
size_ int64 N File size
url_ string N File download address obtained after uploading to the cloud

File:nim_talk_helper.h

Namespace:NIM

IMImage

Base class IMFile

Member/method Type Read-only Description
ToJsonString () - - Serialization method
height_ int N Image width
width_ int N Sender ID, filled out by server, which the sender may ignore

File:nim_talk_helper.h

Namespace:NIM

IMAudio

Base class IMFile

Member/method Type Read-only Description
ToJsonString () - - Serialization method
duration_ int N Audio duration, in seconds

File:nim_talk_helper.h

Namespace:NIM

IMVideo

Base class IMFile

Member/method Type Read-only Description
ToJsonString () - - Serialization method
duration_ int N Video duration, in seconds
height_ int N Video height
width_ int N Video width

File:nim_talk_helper.h

Namespace:NIM

IMLocation

Member/method Type Read-only Description
ToJsonString () - - Serialization method
description_ string N Location description content
latitude_ double N Latitude position
longitude_ double N Longitude position

File:nim_talk_helper.h

Namespace:NIM

IMBotRobot

Member/method Type Read-only Description
ToJsonString () - - Serialization method
out_msg_ bool N Whether the reply is made by robot, yes: true, no: false (false by default)
related_msg_id_ string N The field carried in robot reply, which indicates the message ID associated with the reply
robot_accid_ string N YunXin robot ID
robot_msg_content_ Json::Value N The field carried in robot reply, which indicates the content of the reply, for definition of the field content, refer to the Demo source code or baud development document
robot_msg_flag_ string N The field carried in robot reply, which indicates the type of the reply, for definition of the type, refer to the Demo source code or baud development document
sent_param_ Json::Value N The required field for sending by robot. For the definition of field content, refer to the Demo source code or baud development document

File:nim_talk_helper.h

Namespace:NIM

MessageArcEventArgs

Transmission gate

SendMessageArc

Transmission gate

TeamMemberProperty

Transmission gate

TeamEventCallback

Transmission gate

Was this page helpful?
Yes
No
  • Description of class and constant definitions
  • NIMSDKLogLevel
  • NIMProxyType
  • NIMLogoutType
  • NIMIMMessage
  • NIMMessageType
  • NIMSessionType
  • IMMessage
  • NIMMessageFeature
  • NIMClientType
  • NIMMsgLogStatus
  • NIMMsgLogSubStatus
  • MessageSetting
  • IMFile
  • IMImage
  • IMAudio
  • IMVideo
  • IMLocation
  • IMBotRobot
  • MessageArcEventArgs
  • SendMessageArc
  • TeamMemberProperty
  • TeamEventCallback