EMChatConfigs

EMChatConfigs

new EMChatConfigs(resourcePath, workPath, appKey, deviceId)

Source:
EMCallback constructor.
Parameters:
Name Type Description
resourcePath string 资源文件存储路径
workPath string 日志文件存储路径
appKey string appKey,官网应用申请得到
deviceId Number 设备ID,一般设为0

Methods

clientResource() → {String}

Source:
get client resource.
Returns:
返回客户端Resouce
Type
String

deviceUuid() → {String}

Source:
get device unique id.
Returns:
返回设备ID
Type
String

getAppKey() → {String}

Source:
get the app key.
Returns:
返回appKey
Type
String

getAutoAcceptFriend() → {Bool}

Source:
get if auto accept friend invitation.
Returns:
获取是否自动同意好友申请
Type
Bool

getAutoAcceptGroup() → {Bool}

Source:
get if auto accept group invitation.
Returns:
获取是否自动同意组邀请
Type
Bool

getAutoConversationLoaded() → {Bool}

Source:
get if load all conversation when login.
Returns:
获取登录时是否自动加载所有会话
Type
Bool

getAutoDownloadThumbnail() → {Bool}

Source:
get auto download thumbnail or not.
Returns:
返回是否自动下载附件
Type
Bool

getDeleteMessageAsExitChatRoom() → {Bool}

Source:
get delete messages as exit chatroom.
Returns:
返回退出聊天室时,是否退出消息
Type
Bool

getDeleteMessageAsExitGroup() → {Bool}

Source:
get if delete message when exit group.
Returns:
获取退出组时,是否删除消息
Type
Bool

getDeviceID() → {Number}

Source:
return device unique id.
Returns:
返回设备ID
Type
Number

getDeviceName() → {String}

Source:
return device name.
Returns:
返回设备名称
Type
String

getDnsURL() → {String}

Source:
get dns url.
Returns:
返回dns地址
Type
String

getDownloadPath() → {String}

Source:
get the download path.
Returns:
返回下载路径
Type
String

getEnableConsoleLog() → {Bool}

Source:
get if output the log to console.
Returns:
获取是否输出日志到控制台
Type
Bool

getIsChatroomOwnerLeaveAllowed() → {Bool}

Source:
get if chatroom owner can leave.
Returns:
获取聊天室所有人是否可以退出
Type
Bool

getIsSandboxMode() → {Bool}

Source:
get the sandbox mode.
Returns:
获取是否沙盒模式
Type
Bool

getLogPath() → {String}

Source:
get the log path.
Returns:
返回日志存储路径
Type
String

getNumOfMessageLoaded() → {Number}

Source:
get the number of message load at first time.
Returns:
获取会话默认加载的消息条数
Type
Number

getOs() → {Number}

Source:
get os type.
Returns:
获取操作系统类型
Type
Number

getOsVersion() → {String}

Source:
return os version.
Returns:
获取操作系统版本
Type
String

getRequireDeliveryAck() → {Bool}

Source:
get if need message delivery ack.
Returns:
获取消息传输是否需要到达确认
Type
Bool

getRequireReadAck() → {Bool}

Source:
get if need message read ack.
Returns:
获取消息是否需要已读确认
Type
Bool

getResourcePath() → {String}

Source:
get the resource path.
Returns:
返回资源存储路径
Type
String

getSdkVersion() → {String}

Source:
return sdk version.
Returns:
返回sdk版本
Type
String

getSortMessageByServerTime() → {Bool}

Source:
get sort message by server time or not.
Returns:
消息是否按服务器时间排序
Type
Bool

getTransferAttachments() → {Bool}

Source:
get transfer attachments or not.
Returns:
返回是否传输附件
Type
Bool

getUsingHttpsOnly() → {Bool}

Source:
get using https only.
Returns:
返回是否只支持https协议
Type
Bool

getWorkPath() → {String}

Source:
get the work path.
Returns:
返回工作路径
Type
String

privateConfigs() → {EMChatPrivateConfigs}

Source:
return private config EMChatPrivateConfigs. used for im private deploy.
Returns:
返回系统设置
Type
EMChatPrivateConfigs

setAppKey(appKey) → {void}

Source:
set the app key.
Parameters:
Name Type Description
appKey String 设置appKey
Returns:
Type
void

setAutoAcceptFriend(b) → {void}

Source:
set if auto accept friend invitation. default is false.
Parameters:
Name Type Description
b Bool
Returns:
设置是否自动同意好友申请
Type
void

setAutoAcceptGroup(b) → {void}

Source:
set if auto accept group invitation. default is true.
Parameters:
Name Type Description
b Bool 设置是否自动同意组邀请
Returns:
Type
void

setAutoConversationLoaded(b) → {void}

Source:
set if need load all conversation when login. default is true.
Parameters:
Name Type Description
b Bool 设置登录时是否自动加载所有会话
Returns:
Type
void

setAutoDownloadThumbnail(autoDownload) → {void}

Source:
set auto download thumbnail attachments or not. default is true.
Parameters:
Name Type Description
autoDownload Bool 设置是否自动下载附件
Returns:
Type
void

setClientResource(resource) → {void}

Source:
set client resource.
Parameters:
Name Type Description
resource String 设置客户端Resouce
Returns:
Type
void

setDeleteMessageAsExitChatRoom(b) → {void}

Source:
set delete messages as exit chatroom. default is true.
Parameters:
Name Type Description
b Bool 设置退出聊天室时,是否删除消息
Returns:
Type
void

setDeleteMessageAsExitGroup(b) → {void}

Source:
set if delete message when exit group. default is true.
Parameters:
Name Type Description
b Bool 设置退出组时,是否删除消息
Returns:
Type
void

setDeviceName(name) → {void}

Source:
set device name.
Parameters:
Name Type Description
name String 设置设备名称
Returns:
Type
void

setDnsURL(url) → {void}

Source:
set dns url.
Parameters:
Name Type Description
url String 设置dns地址
Returns:
Type
void

setDownloadPath(path) → {void}

Source:
set the download path.
Parameters:
Name Type Description
path String 下载路径
Returns:
Type
void

setEnableConsoleLog(b) → {void}

Source:
set if output the log to console. default is false.
Parameters:
Name Type Description
b Bool 设置是否输出日志到控制台
Returns:
Type
void

setIsChatroomOwnerLeaveAllowed(b) → {void}

Source:
set if chatroom owner can leave. default is true.
Parameters:
Name Type Description
b Bool 设置聊天室所有人是否可以退出
Returns:
Type
void

setIsSandboxMode(b) → {void}

Source:
set sandbox mode. default is false.
Parameters:
Name Type Description
b Bool 设置是否沙盒模式
Returns:
Type
void

setLogLevel(level) → {void}

Source:
set log output level. default is DEBUG_LEVEL. { DEBUG_LEVEL = 0, WARNING_LEVEL = 1, ERROR_LEVEL = 2 }
Parameters:
Name Type Description
level Number 设置日志输出等级
Returns:
Type
void

setLogPath(path) → {void}

Source:
set the log path.
Parameters:
Name Type Description
path String 日志存储路径
Returns:
Type
void

setNumOfMessageLoaded(num) → {void}

Source:
set the number of message load at first time. default is 20.
Parameters:
Name Type Description
num Number 设置会话默认加载的消息条数
Returns:
Type
void

setOs(osType) → {void}

Source:
set os type. default data is 2, type is Linux. { OS_IOS = 0, OS_ANDROID = 1, OS_LINUX = 2, OS_OSX = 3, OS_MSWIN = 4, OS_OTHER = 16, }
Parameters:
Name Type Description
osType Number 设置操作系统类型,0为IOS,1为ANDROID,2为LINUX,3为mac,4为win,16为其他
Returns:
Type
void

setOsVersion(osVersion) → {void}

Source:
set os version.
Parameters:
Name Type Description
osVersion String 设置操作系统版本
Returns:
Type
void

setRequireDeliveryAck(b) → {void}

Source:
set if need message delivery ack. default is false.
Parameters:
Name Type Description
b Bool 设置消息传输是否需要到达确认
Returns:
Type
void

setRequireReadAck(b) → {void}

Source:
set if need message read ack. default is true.
Parameters:
Name Type Description
b Bool 设置消息是否需要已读确认
Returns:
Type
void

setSdkVersion(version) → {void}

Source:
set sdk version.
Parameters:
Name Type Description
version String 设置sdk版本
Returns:
Type
void

setSortMessageByServerTime(sortByServerTime) → {void}

Source:
set sort message by server time or not. default is true.
Parameters:
Name Type Description
sortByServerTime Bool 消息是否按服务器时间排序
Returns:
Type
void

setTransferAttachments(transfer) → {void}

Source:
set transfer attachments or not. default is true.
Parameters:
Name Type Description
transfer Bool 设置是否传输附件
Returns:
Type
void

setUsingHttpsOnly(httpsOnly) → {void}

Source:
set using https only. default is false.
Parameters:
Name Type Description
httpsOnly Bool 设置是否只支持https协议
Returns:
Type
void