hyphenate_SDK3.0  3.6.0
hyphenatejavaIMSDK
Public 成员函数 | 所有成员列表
com.hyphenate.chat.EMOptions类 参考

Public 成员函数

boolean getRequireAck ()
 
void setRequireAck (boolean requireAck)
 
boolean getRequireDeliveryAck ()
 
void setRequireDeliveryAck (boolean requireDeliveryAck)
 
boolean getAcceptInvitationAlways ()
 
void setAcceptInvitationAlways (boolean value)
 
void setDeleteMessagesAsExitGroup (boolean delete)
 
boolean isDeleteMessagesAsExitGroup ()
 
void setAutoAcceptGroupInvitation (boolean value)
 
boolean isAutoAcceptGroupInvitation ()
 
void allowChatroomOwnerLeave (boolean allowed)
 
boolean isChatroomOwnerLeaveAllowed ()
 
boolean isSortMessageByServerTime ()
 
void setSortMessageByServerTime (boolean sortByServerTime)
 
void setAppKey (String appkey)
 
String getAppKey ()
 
void setIMServer (String imServer)
 
void setImPort (int imPort)
 
void setRestServer (String restServer)
 
String getRestServer ()
 
String getImServer ()
 
int getImPort ()
 
void setAutoLogin (boolean autoLogin)
 
boolean getAutoLogin ()
 
String getFCMNumber ()
 
void setFCMNumber (String number)
 
boolean isUseFCM ()
 
void setUseFCM (boolean useFCM)
 
void setMipushConfig (String mipushAppid, String mipushAppkey)
 
EMChatConfigPrivate.EMMipushConfig getMipushConfig ()
 
void enableDNSConfig (boolean enable)
 
boolean getEnableDNSConfig ()
 
void setUseHttps (boolean _useHttps)
 
void setUsingHttpsOnly (boolean _usingHttpsOnly)
 
boolean getUsingHttpsOnly ()
 
void setAutoTransferMessageAttachments (boolean transfer)
 
boolean getAutoTransferMessageAttachments ()
 
void setAutoDownloadThumbnail (boolean autodownload)
 
boolean getAutodownloadThumbnail ()
 
String getVersion ()
 
String getAccessToken ()
 
String getAccessToken (boolean b)
 
void setDnsUrl (String dnsUrl)
 
String getDnsUrl ()
 
EMPushConfig getPushConfig ()
 
void setPushConfig (EMPushConfig pushConfig)
 

详细描述

EMChatOptions 提供环信sdk聊天相关的设置。用户可以用来配置SDK的各种参数,选项 比如,发送消息加密,受到消息是否播放提示音

成员函数说明

void com.hyphenate.chat.EMOptions.allowChatroomOwnerLeave ( boolean  allowed)

设置是否允许聊天室owner离开并删除会话记录,意味着owner再不会受到任何消息

参数
allowed是否允许聊天室owner离开
boolean com.hyphenate.chat.EMOptions.getAcceptInvitationAlways ( )

获取是否自动接受加好友邀请。缺省true

返回
String com.hyphenate.chat.EMOptions.getAppKey ( )

获取appkey

boolean com.hyphenate.chat.EMOptions.getAutodownloadThumbnail ( )

是否自动下载缩略图,默认为true。

boolean com.hyphenate.chat.EMOptions.getAutoLogin ( )

获取是否自动登录

返回
boolean com.hyphenate.chat.EMOptions.getAutoTransferMessageAttachments ( )

获取是否使用环信服务器进行上传下载,默认值是true。

String com.hyphenate.chat.EMOptions.getFCMNumber ( )

获取FCM(GCM升级版->FCM)推送id

int com.hyphenate.chat.EMOptions.getImPort ( )

获取设置的im server端口号

返回
String com.hyphenate.chat.EMOptions.getImServer ( )

获取设置的im server

返回
EMChatConfigPrivate.EMMipushConfig com.hyphenate.chat.EMOptions.getMipushConfig ( )

获取用于小米推送的appid和appkey

boolean com.hyphenate.chat.EMOptions.getRequireAck ( )

获取已读确认设置,缺省 true 如果设为true,会要求消息的接受方发送已读回执。 UI 可以通过注册 下面的intent receiver 接收此回执

返回
是否要求消息的接收方发送已读回执
boolean com.hyphenate.chat.EMOptions.getRequireDeliveryAck ( )

获取送达确认设置,缺省 false, 如果设为true,会要求消息的接受方发送送达回执。 UI 可以通过注册 下面的intent receiver 接收此回执

IntentFilter readAckIntentFilter = new IntentFilter(EMChatManager.getInstance().getAckMessageBroadcastAction());
返回
是否需要送达回执
String com.hyphenate.chat.EMOptions.getRestServer ( )

获取设置的rest server

返回
boolean com.hyphenate.chat.EMOptions.getUsingHttpsOnly ( )

只使用https进行REST操作,默认值是false。

返回
boolean com.hyphenate.chat.EMOptions.isAutoAcceptGroupInvitation ( )

获取是否自动接受加群邀请

返回
boolean com.hyphenate.chat.EMOptions.isChatroomOwnerLeaveAllowed ( )

是否允许聊天室owner离开

返回
true 离开并不保留会话记录,否者为 false
boolean com.hyphenate.chat.EMOptions.isDeleteMessagesAsExitGroup ( )

获取退出(主动和被动退出)群组时是否删除聊天消息

返回
true为删除群组相关消息
boolean com.hyphenate.chat.EMOptions.isSortMessageByServerTime ( )

是否按照server收到时间进行排序 默认是false

返回
boolean com.hyphenate.chat.EMOptions.isUseFCM ( )

是否使用谷歌FCM推送

void com.hyphenate.chat.EMOptions.setAcceptInvitationAlways ( boolean  value)

设置是否自动接受加好友邀请。缺省true

参数
value
void com.hyphenate.chat.EMOptions.setAppKey ( String  appkey)

设置appkey

参数
appkey
void com.hyphenate.chat.EMOptions.setAutoAcceptGroupInvitation ( boolean  value)

设置是否自动接受加群邀请

参数
value
void com.hyphenate.chat.EMOptions.setAutoDownloadThumbnail ( boolean  autodownload)

是否自动下载缩略图,默认是true为自动下载。

参数
autodownload
void com.hyphenate.chat.EMOptions.setAutoLogin ( boolean  autoLogin)

设置自动登录

参数
autoLogin
void com.hyphenate.chat.EMOptions.setAutoTransferMessageAttachments ( boolean  transfer)

是否自动将消息附件上传到环信服务器,默认为True是使用环信服务器上传下载。

参数
transfer
void com.hyphenate.chat.EMOptions.setDeleteMessagesAsExitGroup ( boolean  delete)

设置退出(主动和被动退出)群组时是否删除聊天消息

参数
deletetrue为删除群组相关消息,默认为true
void com.hyphenate.chat.EMOptions.setFCMNumber ( String  number)

设置FCM(GCM升级版->FCM)推送id

参数
numberFCM sender id
void com.hyphenate.chat.EMOptions.setImPort ( int  imPort)

设置im server 端口号,默认443

参数
imPort
void com.hyphenate.chat.EMOptions.setIMServer ( String  imServer)

设置im server地址

参数
imServer
void com.hyphenate.chat.EMOptions.setMipushConfig ( String  mipushAppid,
String  mipushAppkey 
)

设置用于小米推送的appid和appkey

参数
mipushAppid
mipushAppkey
void com.hyphenate.chat.EMOptions.setRequireAck ( boolean  requireAck)

设置是否需要接受方已读确认

参数
requireAck是否需要已读回执
void com.hyphenate.chat.EMOptions.setRequireDeliveryAck ( boolean  requireDeliveryAck)

设置是否需要接受方送达确认,默认false

参数
requireDeliveryAck是否需要送达确认
void com.hyphenate.chat.EMOptions.setRestServer ( String  restServer)

设置rest server地址

参数
restServer
void com.hyphenate.chat.EMOptions.setUseFCM ( boolean  useFCM)

设置是否开启谷歌FCM推送

参数
useFCM谷歌FCM推送开关
void com.hyphenate.chat.EMOptions.setUseHttps ( boolean  _useHttps)
弃用:
允许使用https,默认值是true
参数
_useHttps
void com.hyphenate.chat.EMOptions.setUsingHttpsOnly ( boolean  _usingHttpsOnly)

只使用https进行REST操作,默认值是false。

参数
_usingHttpsOnly

该类的文档由以下文件生成: