HyphenateChatSDK 4.5.0
构造函数 | 类方法 | 属性 | 所有成员列表
EMOptions类 参考

#import <EMOptions.h>

类 EMOptions 继承关系图:

构造函数

(BOOL isDeleteMessagesWhenExitGroup) - __deprecated_msg
 
(BOOL isDeleteMessagesWhenExitChatRoom) - __deprecated_msg
 
(BOOL isChatroomOwnerLeaveAllowed) - __deprecated_msg
 
(BOOL isAutoAcceptGroupInvitation) - __deprecated_msg
 
(BOOL isAutoAcceptFriendInvitation) - __deprecated_msg
 
(BOOL isAutoDownloadThumbnail) - __deprecated_msg
 

类方法

(instancetype _Nonnull) + optionsWithAppkey:
 

属性

NSString * appkey
 
BOOL enableConsoleLog
 
EMLogLevel logLevel
 
BOOL usingHttpsOnly
 
BOOL isAutoLogin
 
BOOL deleteMessagesOnLeaveGroup
 
BOOL deleteMessagesOnLeaveChatroom
 
BOOL canChatroomOwnerLeave
 
BOOL autoAcceptGroupInvitation
 
BOOL autoAcceptFriendInvitation
 
BOOL autoDownloadThumbnail
 
BOOL enableRequireReadAck
 
BOOL enableDeliveryAck
 
BOOL sortMessageByServerTime
 
BOOL isAutoTransferMessageAttachments
 
NSString * apnsCertName
 
NSString * pushKitCertName
 
AreaCode area
 
BOOL enableStatistics
 
BOOL loadEmptyConversations
 
NSInteger customOSType
 
NSString * customDeviceName
 
BOOL useReplacedMessageContents
 
BOOL includeSendMessageInMessageListener
 
BOOL regardImportMessagesAsRead
 
BOOL enableDnsConfig
 
int chatPort
 
NSString * chatServer
 
NSString * restServer
 
BOOL enableTLSConnection
 
NSString * dnsURL
 

详细描述

SDK 的设置选项。

函数文档

◆ __deprecated_msg [1/6]

- (BOOL isAutoAcceptFriendInvitation) __deprecated_msg ("Use autoAcceptFriendInvitation instead") 

自动同意好友申请。

  • YES:是;
  • (默认)NO:否。

◆ __deprecated_msg [2/6]

- (BOOL isAutoAcceptGroupInvitation) __deprecated_msg ("Use autoAcceptGroupInvitation instead") 

用户自动同意群邀请。

  • (默认)YES:是;
  • NO:否。

◆ __deprecated_msg [3/6]

- (BOOL isAutoDownloadThumbnail) __deprecated_msg ("Use autoDownloadThumbnail instead") 

是否自动下载图片和视频缩略图及语音消息。

  • (默认)YES:是;
  • NO:否。

◆ __deprecated_msg [4/6]

- (BOOL isChatroomOwnerLeaveAllowed) __deprecated_msg ("Use canChatroomOwnerLeave instead") 

是否允许聊天室所有者离开。

  • (默认)YES:是;
  • NO:否。

◆ __deprecated_msg [5/6]

- (BOOL isDeleteMessagesWhenExitChatRoom) __deprecated_msg ("Use deleteMessagesOnLeaveChatroom instead") 

离开聊天室时是否删除所有消息。

  • (默认)YES:是;
  • NO:否。

◆ __deprecated_msg [6/6]

- (BOOL isDeleteMessagesWhenExitGroup) __deprecated_msg ("Use deleteMessagesOnLeaveGroup instead") 

离开群组时是否删除该群所有消息。

  • (默认)YES:是;
  • NO:否。

由 category EMOptions(PrivateDeploy) 提供.

◆ optionsWithAppkey:

+ (instancetype _Nonnull) optionsWithAppkey: (NSString *_Nonnull)  aAppkey

获取 SDK 选项实例。

参数
aAppkeyApp key。
返回
SDK 设置项实例。

属性说明

◆ apnsCertName

- (NSString*) apnsCertName
readwritenonatomiccopy

iOS 特有属性,APNs 推送证书的名称。

该参数只能在调用 initializeSDKWithOptions 时设置,且 app 运行过程中不可以修改。

◆ appkey

- (NSString*) appkey
readnonatomiccopy

app key,是项目的唯一标识。

◆ area

- (AreaCode) area
readwritenonatomicassign

区域代号。

该属性用于限制连接边缘节点的范围,默认为 AreaCodeGLOB

该参数只能在调用 initializeSDKWithOptions 时设置,且 app 运行过程中不能修改。

◆ autoAcceptFriendInvitation

- (BOOL) autoAcceptFriendInvitation
readwritenonatomicassign

是否自动同意好友邀请。

  • (默认)YES:是;
  • NO:否。

◆ autoAcceptGroupInvitation

- (BOOL) autoAcceptGroupInvitation
readwritenonatomicassign

是否自动接受群邀请。

  • (默认)YES:是;
  • NO:否。

◆ autoDownloadThumbnail

- (BOOL) autoDownloadThumbnail
readwritenonatomicassign

是否自动下载图片和视频的缩略图及语音消息。

  • (默认)YES:是;
  • NO:否。

◆ canChatroomOwnerLeave

- (BOOL) canChatroomOwnerLeave
readwritenonatomicassign

是否允许聊天室所有者离开。

  • (默认)YES:是;
  • NO:否。

◆ chatPort

- (int) chatPort
readwritenonatomicassign

Chat 服务器端口。

enableDnsConfig 为 NO 时有效。只能在 initializeSDKWithOptions: 中设置,不能在程序运行过程中动态修改。

由 category EMOptions(PrivateDeploy) 提供.

◆ chatServer

- (NSString*) chatServer
readwritenonatomiccopy

The chat 服务器地址。

enableDnsConfig 为 NO 时生效。只能在 initializeSDKWithOptions: 中设置,不能在程序运行过程中动态修改。

由 category EMOptions(PrivateDeploy) 提供.

◆ customDeviceName

- (NSString*) customDeviceName
readwriteatomicstrong

自定义设备名称。

该属性只能在调用 initializeSDKWithOptions 时设置,而且 app 运行过程中不能修改该参数的设置。

◆ customOSType

- (NSInteger) customOSType
readwritenonatomicassign

自定义系统类型。

该属性只能在调用 initializeSDKWithOptions 时设置,而且 app 运行过程中不能修改该参数的设置。

◆ deleteMessagesOnLeaveChatroom

- (BOOL) deleteMessagesOnLeaveChatroom
readwritenonatomicassign

离开聊天室时是否删除所有消息。

  • (默认)YES:是;
  • NO:否。

◆ deleteMessagesOnLeaveGroup

- (BOOL) deleteMessagesOnLeaveGroup
readwritenonatomicassign

离开群组时是否删除该群所有消息。

  • (默认)YES:是;
  • NO:否。

◆ dnsURL

- (NSString*) dnsURL
readwritenonatomiccopy

DNS URL 地址。

enableDnsConfig为YES时生效,只能在 initializeSDKWithOptions: 中设置,不能在程序运行过程中动态修改。

由 category EMOptions(PrivateDeploy) 提供.

◆ enableConsoleLog

- (BOOL) enableConsoleLog
readwritenonatomicassign

控制台是否输出日志。

  • YES:是;
  • (默认)NO:否。

◆ enableDeliveryAck

- (BOOL) enableDeliveryAck
readwritenonatomicassign

是否发送消息送达回执:

  • YES:SDK 收到单聊消息时会自动发送送达回执;
  • (默认)NO:否。

◆ enableDnsConfig

- (BOOL) enableDnsConfig
readwritenonatomicassign

是否允许使用 DNS, 默认为 YES。

只能在 initializeSDKWithOptions: 中设置,不能在程序运行过程中动态修改。

由 category EMOptions(PrivateDeploy) 提供.

◆ enableRequireReadAck

- (BOOL) enableRequireReadAck
readwritenonatomicassign

是否需要接收已读回执。

  • (默认)YES:是;
  • NO:否。

◆ enableStatistics

- (BOOL) enableStatistics
readwritenonatomicassign

是否开启消息流量统计。

  • YES:开启;
  • (默认)NO: 关闭。

该参数只能在调用 initializeSDKWithOptions 时设置,且 app 运行过程中不能修改。

◆ enableTLSConnection

- (BOOL) enableTLSConnection
readwritenonatomicassign

连接chatServer时,是否启用TLS加密。默认为NO。

enableDnsConfig 为 NO 时生效。只能在 initializeSDKWithOptions: 中设置,不能在程序运行过程中动态修改。

由 category EMOptions(PrivateDeploy) 提供.

◆ includeSendMessageInMessageListener

- (BOOL) includeSendMessageInMessageListener
readwritenonatomicassign

发送成功的消息是否在 ChatManagerDelegate#messagesDidReceive 中回调。

  • YES:是。
  • (默认)NO:否。

◆ isAutoLogin

- (BOOL) isAutoLogin
readwritenonatomicassign

是否自动登录。

  • (默认)YES:是;
  • NO:否。

该参数需要在 SDK 初始化前设置,否则不生效。

◆ isAutoTransferMessageAttachments

- (BOOL) isAutoTransferMessageAttachments
readwritenonatomicassign

是否自动上传或者下载消息中的附件。

  • (默认)YES:是;
  • NO:否。

◆ loadEmptyConversations

- (BOOL) loadEmptyConversations
readwritenonatomicassign

加载会话时是否包括空会话。

  • YES:包含。

(默认)NO:不包含。

该属性只能在调用 initializeSDKWithOptions 时设置,而且 app 运行过程中不能修改该参数的设置。

◆ logLevel

- (EMLogLevel) logLevel
readwritenonatomicassign

日志级别:

  • (默认)EMLogLevelDebug:所有等级的日志;
  • EMLogLevelWarning:警告及错误;
  • EMLogLevelError:错误。

◆ pushKitCertName

- (NSString*) pushKitCertName
readwritenonatomiccopy

iOS 特有属性,PushKit 的证书名称。

该参数只能在调用 initializeSDKWithOptions 时设置,且 app 运行过程中不可以修改。

◆ regardImportMessagesAsRead

- (BOOL) regardImportMessagesAsRead
readwritenonatomicassign

是否将服务器导入的消息设置为已读:

  • YES:已读。会话的未读消息数 EMConversation#unreadMessagesCount 不发生变化。
  • (默认)NO:未读。EMConversation#unreadMessagesCount 的数量会增加。

◆ restServer

- (NSString*) restServer
readwritenonatomiccopy

REST 服务器地址。

enableDnsConfig 为 NO 时生效。只能在 initializeSDKWithOptions: 中设置,不能在程序运行过程中动态修改。

由 category EMOptions(PrivateDeploy) 提供.

◆ sortMessageByServerTime

- (BOOL) sortMessageByServerTime
readwritenonatomicassign

从数据库加载消息时是否按服务器时间排序。

  • (默认)YES:按服务器时间排序;
  • NO:否。

◆ useReplacedMessageContents

- (BOOL) useReplacedMessageContents
readwritenonatomicassign

当发送的文本消息的内容被文本审核(Moderation)服务替换时,是否需要返回给发送方。

  • YES:将内容替换后的消息返回给发送方。
  • (默认)NO:将原消息返回给发送方。

该属性只能在调用 initializeSDKWithOptions 时设置,而且 app 运行过程中不能修改该参数的设置。

◆ usingHttpsOnly

- (BOOL) usingHttpsOnly
readwritenonatomicassign

是否只使用 HTTPS 协议。

  • YES:是:
  • (默认)NO:否。

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