hyphenate_SDK3.0  3.0.1
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)
 
boolean getRequireServerAck ()
 
void setRequireServerAck (boolean requireServerAck)
 
void setDeleteMessagesAsExitGroup (boolean delete)
 
boolean isDeleteMessagesAsExitGroup ()
 
void setAutoAcceptGroupInvitation (boolean value)
 
boolean isAutoAcceptGroupInvitation ()
 
void allowChatroomOwnerLeave (boolean allowed)
 
boolean isChatroomOwnerLeaveAllowed ()
 
void setAppKey (String appkey)
 
String getAppKey ()
 
void setAutoLogin (boolean autoLogin)
 
boolean getAutoLogin ()
 
void setGCMNumber (String number)
 
String getGCMNumber ()
 
void setMipushConfig (String mipushAppid, String mipushAppkey)
 
EMMipushConfig getMipushConfig ()
 
void enableDNSConfig (boolean enable)
 
boolean getEnableDNSConfig ()
 

详细描述

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

参数
appkey
boolean com.hyphenate.chat.EMOptions.getAutoLogin ( )

获取是否自动登录

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

获取GCM推送id

参数
GCMsender id
EMMipushConfig com.hyphenate.chat.EMOptions.getMipushConfig ( )

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

参数
mipushAppid
mipushAppkey
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());
返回
是否需要送达回执
boolean com.hyphenate.chat.EMOptions.getRequireServerAck ( )

获取服务器端接收回执设置,缺省 true 如果设为true,发送消息时会等待服务器端发送的相应接收回执。

返回
弃用:
boolean com.hyphenate.chat.EMOptions.isAutoAcceptGroupInvitation ( )

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

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

是否允许聊天室owner离开

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

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

返回
true为删除群组相关消息
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.setAutoLogin ( boolean  autoLogin)

设置自动登录

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

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

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

设置GCM推送id

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

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

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

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

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

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

参数
是否需要送达确认
void com.hyphenate.chat.EMOptions.setRequireServerAck ( boolean  requireServerAck)

设置是否需要服务器端确认接收到消息

参数
requireAck

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