hyphenate_SDK4.0 4.2.3-lite
hyphenate java IM SDK
Public Member Functions | List of all members
com.hyphenate.chat.EMOptions Class Reference

Public Member Functions

boolean getRequireAck ()
 
void setRequireAck (boolean requireAck)
 
boolean getRequireDeliveryAck ()
 
void setRequireDeliveryAck (boolean requireDeliveryAck)
 
void allowChatroomOwnerLeave (boolean allowed)
 
boolean canChatroomOwnerLeave ()
 
void setDeleteMessagesAsExitChatRoom (boolean delete)
 
boolean deleteMessagesOnLeaveChatroom ()
 
boolean isSortMessageByServerTime ()
 
void setSortMessageByServerTime (boolean sortByServerTime)
 
void setAppKey (String appkey)
 
String getAppKey ()
 
void setIMServer (String imServer)
 
String getImServer ()
 
void setImPort (int imPort)
 
int getImPort ()
 
void setRestServer (String restServer)
 
String getRestServer ()
 
String getReportServer ()
 
void setReportServer (String reportServer)
 
void setAutoLogin (boolean autoLogin)
 
boolean getAutoLogin ()
 
void enableDNSConfig (boolean enable)
 
boolean getEnableDNSConfig ()
 
void setUsingHttpsOnly (boolean _usingHttpsOnly)
 
boolean getUsingHttpsOnly ()
 
void setAutoTransferMessageAttachments (boolean transfer)
 
boolean getAutoTransferMessageAttachments ()
 
void setAutoDownloadThumbnail (boolean autodownload)
 
boolean getAutodownloadThumbnail ()
 
void setFixedHBInterval (int interval)
 
int getFixedInterval ()
 
String getVersion ()
 
String getAccessToken ()
 
String getAccessToken (boolean b)
 
void setDnsUrl (String dnsUrl)
 
String getDnsUrl ()
 
boolean isLoadEmptyConversations ()
 
void setLoadEmptyConversations (boolean isLoadEmptyConversations)
 

Detailed Description

The settings of the chat SDK.

You can set parameters and options of the SDK.

For example, whether to encrypt the messages before sending, whether to automatically accept the friend invitations.

Member Function Documentation

◆ allowChatroomOwnerLeave()

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

Sets whether to allow the chat room owner to leave the chat room.

Parameters
allowedWhether to allow the owner of chat room to leave.
  • (Default)true: : When the owner leave, do not keep the conversation;
  • false: When the owner leave do keep the conversation.

◆ canChatroomOwnerLeave()

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

Gets whether to allow owner of chat room to leave.

Returns
- (Default)true: allow owner of chat room to leave;
  • false: do not allow owner of chat room to leave.

◆ deleteMessagesOnLeaveChatroom()

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

Gets whether to delete the chat room message when leaving the chat room.

Returns
- (Default)true: Delete the chat room related message record when leaving the chat room.
  • false: Do not delete the chat room related message record when leaving the chat room.

◆ enableDNSConfig()

void com.hyphenate.chat.EMOptions.enableDNSConfig ( boolean  enable)

Sets whether to disable DNS.

  • (Default)true: Disable DNS;
  • false: Do not disable DNS.

◆ getAccessToken() [1/2]

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

Gets the access token from the local database.

Returns
The access token.

◆ getAccessToken() [2/2]

String com.hyphenate.chat.EMOptions.getAccessToken ( boolean  b)

Whether to get the access token from the server.

Parameters
bWhether to get the access token from server.
  • (Default) true: Get the access token from server.
  • false: Do not get the access token from server.
Returns
The access token.

◆ getAppKey()

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

Gets the app key.

◆ getAutodownloadThumbnail()

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

Gets whether to download the thumbnail automatically.

Returns
Whether to download the thumbnail automatically.
  • (Default)true: Download the thumbnail automatically;
  • false: Do not download the thumbnail automatically.

◆ getAutoLogin()

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

Checks whether the automatic login is enabled.

Returns
- (Default)true: Automatic login is enabled;
  • false: Automatic login is disabled.

◆ getAutoTransferMessageAttachments()

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

Gets whether to upload the message attachments automatically to the chat server.

Returns
Whether to upload the message attachments automatically to the chat server.
  • (Default)true: Use the default way to upload and download the message attachments by chat server;
  • false: Do not use the default way to upload and download the message attachments by chat server, using a customized path instead.

◆ getDnsUrl()

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

Gets the DNS url.

Returns
The DNS url.

◆ getEnableDNSConfig()

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

Gets whether to disable DNS.

  • (Default) true: Disable DNS;
  • false: Do not disable DNS.
Returns
Returns whether to disable DNS.

◆ getFixedInterval()

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

Gets the fixed heart beat interval.

Returns
The heartbeat interval, in seconds. We recommend setting this value between 30 to 300.

◆ getImPort()

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

Gets the im server port.

Returns
The im server port.

◆ getImServer()

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

Gets the im server url.

Returns
The im server url.

◆ getReportServer()

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

Gets the report server.

Returns
The report server url, may be null.

◆ getRequireAck()

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

Gets whether the read receipt is required by the message receiver.

Returns
Whether the read receipt is required.
  • (Default) true: The read receipt is required;
  • false: The read receipt is not required.

◆ getRequireDeliveryAck()

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

Gets whether the delivery receipt is required.

Returns
Whether the delivery receipt is required.
  • (Default)true: The read receipt is required;
  • false: The read receipt is not required.

◆ getRestServer()

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

Gets the REST server.

Returns
The REST server url.

◆ getUsingHttpsOnly()

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

Gets whether only HTTPS is used for REST operations.

Returns
Whether only HTTPS is used for REST operations.
  • (Default) true: Only HTTPS is used;
  • false: Both HTTP and HTTPS can be used.

◆ getVersion()

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

Gets the SDK version.

Returns
The SDK version.

◆ isLoadEmptyConversations()

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

Checks whether to include empty conversations when the SDK loads conversations from server.

Returns
Whether to include empty conversations when the SDK loads conversations from server.
  • (Default)false: Empty conversations are excluded.
  • true: Empty conversations are included.

◆ isSortMessageByServerTime()

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

Gets whether to sort messages by the server received time.

Returns
Returns the result of whether sort message by the server received time.
  • (Default)true: Sort messages by the server received time;
  • false: Do not sort messages by the server received time.

◆ setAppKey()

void com.hyphenate.chat.EMOptions.setAppKey ( String  appkey)

Sets the app key.

Parameters
appkeyThe app key you got from the console when create an app.

◆ setAutoDownloadThumbnail()

void com.hyphenate.chat.EMOptions.setAutoDownloadThumbnail ( boolean  autodownload)

Sets whether to auto download the thumbnail.

Parameters
autodownloadWhether to download the thumbnail automatically.
  • (Default)true: Download the thumbnail automatically;
  • false: Do not download the thumbnail automatically.

◆ setAutoLogin()

void com.hyphenate.chat.EMOptions.setAutoLogin ( boolean  autoLogin)

Enables/Disables automatic login.

Parameters
autoLogin
  • (Default)true: Enables automatic login;
  • false: Disables automatic login.

◆ setAutoTransferMessageAttachments()

void com.hyphenate.chat.EMOptions.setAutoTransferMessageAttachments ( boolean  transfer)

Sets whether to upload the message attachments automatically to the chat server.

Parameters
transferWhether to upload the message attachments to the chat server.
  • (Default) true: Use the default way to upload and download the message attachments by chat server;
  • false: Do not use the default way to upload and download the message attachments by chat server, using a customized path instead.

◆ setDeleteMessagesAsExitChatRoom()

void com.hyphenate.chat.EMOptions.setDeleteMessagesAsExitChatRoom ( boolean  delete)

Sets whether to delete the chat room message when leaving the chat room.

Parameters
delete-(Default)true: Delete the chat room related message record when leaving the chat room.
  • false: Do not delete the chat room related message record when leaving the chat room.

◆ setDnsUrl()

void com.hyphenate.chat.EMOptions.setDnsUrl ( String  dnsUrl)

Sets the DNS url.

Parameters
dnsUrlThe DNS url.

◆ setFixedHBInterval()

void com.hyphenate.chat.EMOptions.setFixedHBInterval ( int  interval)

Sets a fixed heartbeat interval. If not set, the optimal heartbeat interval is automatically detected.

Parameters
intervalThe interval of heart beat, in seconds (30~300).

◆ setImPort()

void com.hyphenate.chat.EMOptions.setImPort ( int  imPort)

Sets the custom im server port.

Parameters
imPortThe im server port.

◆ setIMServer()

void com.hyphenate.chat.EMOptions.setIMServer ( String  imServer)

Sets the custom im message server url.

Parameters
imServerThe im message server url.

◆ setLoadEmptyConversations()

void com.hyphenate.chat.EMOptions.setLoadEmptyConversations ( boolean  isLoadEmptyConversations)

Sets whether to include empty conversations when the SDK loads conversations from server.

As for the call sequence, this method comes before EMClient#init(Context, EMOptions).

Parameters
isLoadEmptyConversationsWhether to include empty conversations when the SDK loads conversations from server:
  • true: Empty conversations are included.
  • (Default)false: Empty conversations are excluded.

◆ setReportServer()

void com.hyphenate.chat.EMOptions.setReportServer ( String  reportServer)

Sets the custom report server.

Parameters
reportServerThe report server url.

◆ setRequireAck()

void com.hyphenate.chat.EMOptions.setRequireAck ( boolean  requireAck)

Sets whether to require the read receipt.

Parameters
requireAckWhether the read receipt is required.
  • (Default) true: The read receipt is required;
  • false: The read receipt is not required.

◆ setRequireDeliveryAck()

void com.hyphenate.chat.EMOptions.setRequireDeliveryAck ( boolean  requireDeliveryAck)

Sets whether the delivery receipt is required.

Parameters
requireDeliveryAckWhether the delivery receipt is required.
  • (Default)true: The delivery receipt is required;
  • false: The delivery receipt is not required.

◆ setRestServer()

void com.hyphenate.chat.EMOptions.setRestServer ( String  restServer)

Sets the custom REST server.

Parameters
restServerThe REST server url.

◆ setSortMessageByServerTime()

void com.hyphenate.chat.EMOptions.setSortMessageByServerTime ( boolean  sortByServerTime)

Sets whether to sort messages by server received time.

Parameters
sortByServerTime
  • (Default)true: Sort messages by the server received time.
  • false: Do not sort messages by the server received time.

◆ setUsingHttpsOnly()

void com.hyphenate.chat.EMOptions.setUsingHttpsOnly ( boolean  _usingHttpsOnly)

Sets whether only HTTPS is used for REST operation.

Parameters
_usingHttpsOnlyWhether only HTTPS is used.
  • (Default)true: Only HTTPS is used;
  • false: Both HTTP and HTTPS can be used.

The documentation for this class was generated from the following file: