agora_chat_SDK 1.0.6
agora java chat SDK
Public Member Functions | List of all members
io.agora.chat.ChatOptions Class Reference

Public Member Functions

boolean getRequireAck ()
 
void setRequireAck (boolean requireAck)
 
boolean getRequireDeliveryAck ()
 
boolean getFpaEnable ()
 
void setFpaEnable (boolean fpaEnable)
 
void setRequireDeliveryAck (boolean requireDeliveryAck)
 
boolean getAcceptInvitationAlways ()
 
void setAcceptInvitationAlways (boolean value)
 
void setDeleteMessagesAsExitGroup (boolean delete)
 
boolean isDeleteMessagesAsExitGroup ()
 
boolean deleteMessagesOnLeaveGroup ()
 
void setAutoAcceptGroupInvitation (boolean value)
 
boolean isAutoAcceptGroupInvitation ()
 
boolean autoAcceptGroupInvitations ()
 
void allowChatroomOwnerLeave (boolean allowed)
 
boolean isChatroomOwnerLeaveAllowed ()
 
boolean canChatroomOwnerLeave ()
 
void setDeleteMessagesAsExitChatRoom (boolean delete)
 
boolean isDeleteMessagesAsExitChatRoom ()
 
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 ()
 
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 ()
 
void setFixedHBInterval (int interval)
 
int getFixedInterval ()
 
String getVersion ()
 
String getAccessToken ()
 
String getAccessToken (boolean b)
 
void setDnsUrl (String dnsUrl)
 
String getDnsUrl ()
 
PushConfig getPushConfig ()
 
void setPushConfig (PushConfig pushConfig)
 
boolean isEnableStatistics ()
 
void setEnableStatistics (boolean enableStatistics)
 

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 io.agora.chat.ChatOptions.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.

◆ autoAcceptGroupInvitations()

boolean io.agora.chat.ChatOptions.autoAcceptGroupInvitations ( )

Gets whether to accept group invitations automatically.

Returns
Returns the result of whether to accept group invitation automatically.
  • (Default)true: Accept group invitations automatically.
  • false: Do not accept group invitations automatically.

◆ canChatroomOwnerLeave()

boolean io.agora.chat.ChatOptions.canChatroomOwnerLeave ( )

Gets whether to allow owner of chat room to leave.

Returns
- (Default)true: When the owner leave, do not keep the conversation;
  • false: When the owner leave, do keep the conversation.

◆ deleteMessagesOnLeaveChatroom()

boolean io.agora.chat.ChatOptions.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.

◆ deleteMessagesOnLeaveGroup()

boolean io.agora.chat.ChatOptions.deleteMessagesOnLeaveGroup ( )

Gets whether to delete the group message when leaving a group.

Returns
- (Default)true: Delete the messages when leaving a group.
  • false: Do not delete the messages when leaving a group.

◆ enableDNSConfig()

void io.agora.chat.ChatOptions.enableDNSConfig ( boolean  enable)

Sets whether to disable DNS.

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

◆ getAcceptInvitationAlways()

boolean io.agora.chat.ChatOptions.getAcceptInvitationAlways ( )

Gets whether to accept other user's friend invitations automatically.

Returns
Whether to accept friend invitation automatically.
  • (Default)true: Accepting friend invitation automatically.
  • false: Do not accepting friend invitation automatically.

◆ getAccessToken() [1/2]

String io.agora.chat.ChatOptions.getAccessToken ( )

Gets the access token from the local database.

Returns
The access token.

◆ getAccessToken() [2/2]

String io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.getAppKey ( )

Gets the app key.

◆ getAutodownloadThumbnail()

boolean io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.getAutoLogin ( )

Checks whether the automatic login is enabled.

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

◆ getAutoTransferMessageAttachments()

boolean io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.getDnsUrl ( )

Gets the DNS url.

Returns
The DNS url.

◆ getEnableDNSConfig()

boolean io.agora.chat.ChatOptions.getEnableDNSConfig ( )

Gets whether to disable DNS.

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

◆ getFCMNumber()

String io.agora.chat.ChatOptions.getFCMNumber ( )

Gets the FCM sender ID.

Deprecated:
Use PushConfig#getFcmSenderId() instead.

◆ getFixedInterval()

int io.agora.chat.ChatOptions.getFixedInterval ( )

Gets the fixed heart beat interval.

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

◆ getFpaEnable()

boolean io.agora.chat.ChatOptions.getFpaEnable ( )

Gets whether the fpa function is used.

Returns
whether the fpa function is used.
  • (Default)false: the fpa function is not used.
  • true: the fpa function is used;

◆ getImPort()

int io.agora.chat.ChatOptions.getImPort ( )

Gets the im server port.

Returns
The im server port.

◆ getImServer()

String io.agora.chat.ChatOptions.getImServer ( )

Gets the im server url.

Returns
The im server url.

◆ getMipushConfig()

EMChatConfigPrivate.EMMipushConfig io.agora.chat.ChatOptions.getMipushConfig ( )

Gets the App ID and app key for Xiaomi Push.

Deprecated:
Use PushConfig#getMiAppId() and PushConfig#getMiAppKey() instead.

◆ getPushConfig()

PushConfig io.agora.chat.ChatOptions.getPushConfig ( )

Gets the push configuration setting options by user.

◆ getReportServer()

String io.agora.chat.ChatOptions.getReportServer ( )

Gets the report server.

Returns
The report server url, may be null.

◆ getRequireAck()

boolean io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.getRestServer ( )

Gets the REST server.

Returns
The REST server url.

◆ getUsingHttpsOnly()

boolean io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.getVersion ( )

Gets the SDK version.

Returns
The SDK version.

◆ isAutoAcceptGroupInvitation()

boolean io.agora.chat.ChatOptions.isAutoAcceptGroupInvitation ( )

Gets whether to accept a group invitation automatically.

Returns
Returns the result of whether to accept group invitation automatically.
  • (Default)true: Accept group invitations automatically;
  • false: Do not accept group invitations automatically.
Deprecated:
Use ChatOptions#autoAcceptGroupInvitations() instead.

◆ isChatroomOwnerLeaveAllowed()

boolean io.agora.chat.ChatOptions.isChatroomOwnerLeaveAllowed ( )

Gets whether to allow the owner of chat room to leave.

Returns
- (Default)true: When the owner leave, do not keep the conversation;
  • false: When the owner leave do keep the conversation.
Deprecated:
Use ChatOptions#canChatroomOwnerLeave() instead.

◆ isDeleteMessagesAsExitChatRoom()

boolean io.agora.chat.ChatOptions.isDeleteMessagesAsExitChatRoom ( )

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.
Deprecated:
Use ChatOptions#deleteMessagesOnLeaveChatroom() instead.

◆ isDeleteMessagesAsExitGroup()

boolean io.agora.chat.ChatOptions.isDeleteMessagesAsExitGroup ( )

Gets whether to delete the group message when leaving a group.

Returns
- (Default)true: Delete the messages when leaving a group.
  • false: Do not delete the messages when leaving a group.
Deprecated:
Use ChatOptions#deleteMessagesOnLeaveGroup() instead.

◆ isEnableStatistics()

boolean io.agora.chat.ChatOptions.isEnableStatistics ( )

Gets whether to enable the statistics.

Returns
- (Default)true: Enable statistics;
  • false: Do not enable statistics.

◆ isSortMessageByServerTime()

boolean io.agora.chat.ChatOptions.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.

◆ isUseFCM()

boolean io.agora.chat.ChatOptions.isUseFCM ( )

Gets whether to use Google FCM push.

Deprecated:
The FCM push moves to the application layer, no longer requiring this API.

◆ setAcceptInvitationAlways()

void io.agora.chat.ChatOptions.setAcceptInvitationAlways ( boolean  value)

Sets whether to accept the friend invitation automatically.

Parameters
valueWhether to accept the friend invitation automatically.
  • (Default)true: Accepting friend invitation automatically.
  • false: Do not accepting friend invitation automatically.

◆ setAppKey()

void io.agora.chat.ChatOptions.setAppKey ( String  appkey)

Sets the app key.

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

◆ setAutoAcceptGroupInvitation()

void io.agora.chat.ChatOptions.setAutoAcceptGroupInvitation ( boolean  value)

Sets whether to accept a group invitation automatically.

Parameters
valueWhether to accept group invitation automatically.
  • (Default)true: Accept group invitations automatically;
  • false: Do not accept group invitations automatically.

◆ setAutoDownloadThumbnail()

void io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.setAutoLogin ( boolean  autoLogin)

Enables/Disables automatic login.

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

◆ setAutoTransferMessageAttachments()

void io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.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.

◆ setDeleteMessagesAsExitGroup()

void io.agora.chat.ChatOptions.setDeleteMessagesAsExitGroup ( boolean  delete)

Sets whether to delete the group messages when leaving the group.

Parameters
delete
  • (Default)true: Delete the messages when leaving the group.
  • false: Do not delete the messages when leaving a group.

◆ setDnsUrl()

void io.agora.chat.ChatOptions.setDnsUrl ( String  dnsUrl)

Sets the DNS url.

Parameters
dnsUrlThe DNS url.

◆ setEnableStatistics()

void io.agora.chat.ChatOptions.setEnableStatistics ( boolean  enableStatistics)

Sets whether to enable statistics.

Parameters
enableStatisticsWhether to enable statistics.
  • (Default)true: Enable statistics;
  • false: Do not enable statistics.

◆ setFCMNumber()

void io.agora.chat.ChatOptions.setFCMNumber ( String  number)

Sets the FCM sender ID.

Parameters
numberThe FCM sender ID.
Deprecated:
Use PushConfig.Builder#enableFCM(String) instead.

◆ setFixedHBInterval()

void io.agora.chat.ChatOptions.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).

◆ setFpaEnable()

void io.agora.chat.ChatOptions.setFpaEnable ( boolean  fpaEnable)

sets Whether to use fpa function.

Parameters
fpaEnableWhether to use fpa function.
  • (Default)false: not use fpa function;
  • true: use fpa function.

◆ setImPort()

void io.agora.chat.ChatOptions.setImPort ( int  imPort)

Sets the custom im server port.

Parameters
imPortThe im server port.

◆ setIMServer()

void io.agora.chat.ChatOptions.setIMServer ( String  imServer)

Sets the custom im message server url.

Parameters
imServerThe im message server url.

◆ setMipushConfig()

void io.agora.chat.ChatOptions.setMipushConfig ( String  mipushAppid,
String  mipushAppkey 
)

Sets the App ID and app key for Xiaomi Push.

Parameters
mipushAppidThe Xiaomi Push App ID.
mipushAppkeyThe Xiaomi push app key.
Deprecated:
Use PushConfig.Builder#enableMiPush(String, String) instead.

◆ setPushConfig()

void io.agora.chat.ChatOptions.setPushConfig ( PushConfig  pushConfig)

Sets the push configuration.

Parameters
pushConfigThe push configuration.

◆ setReportServer()

void io.agora.chat.ChatOptions.setReportServer ( String  reportServer)

Sets the custom report server.

Parameters
reportServerThe report server url.

◆ setRequireAck()

void io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.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 io.agora.chat.ChatOptions.setRestServer ( String  restServer)

Sets the custom REST server.

Parameters
restServerThe REST server url.

◆ setSortMessageByServerTime()

void io.agora.chat.ChatOptions.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.

◆ setUseFCM()

void io.agora.chat.ChatOptions.setUseFCM ( boolean  useFCM)

Sets whether to enable the Google FCM push.

Parameters
useFCMThe Google FCM push switch.
  • true: Enable the Google FCM push.
  • false: Do not enable the Google FCM push.
Deprecated:
The FCM push moves to the application layer, this API is no longer required.

◆ setUseHttps()

void io.agora.chat.ChatOptions.setUseHttps ( boolean  _useHttps)

Sets whether only HTTPS is used for REST operations.

Parameters
_useHttpsWhether only HTTPS is used for REST operations.
  • (Default)true: Only HTTPS is used.
  • false: Allow to use both HTTP and HTTPS.
Deprecated:
Use setUsingHttpsOnly(boolean) instead.

◆ setUsingHttpsOnly()

void io.agora.chat.ChatOptions.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: