EMOptions.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. /*!
  2. * \~chinese
  3. * @header EMOptions.h
  4. * @abstract SDK的设置选项
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMOptions.h
  10. * @abstract SDK setting options
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMCommonDefs.h"
  16. /*!
  17. * \~chinese
  18. * 日志输出级别
  19. *
  20. * \~english
  21. * Log output level
  22. */
  23. typedef enum {
  24. EMLogLevelDebug = 0, /*! \~chinese 输出所有日志 \~english Output all logs */
  25. EMLogLevelWarning, /*! \~chinese 输出警告及错误 \~english Output warnings and errors */
  26. EMLogLevelError /*! \~chinese 只输出错误 \~english Output errors only */
  27. } EMLogLevel;
  28. /*!
  29. * \~chinese
  30. * SDK的设置选项
  31. *
  32. * \~english
  33. * SDK setting options
  34. */
  35. @interface EMOptions : NSObject
  36. /*!
  37. * \~chinese
  38. * app唯一标识符
  39. *
  40. * \~english
  41. * Application's unique identifier
  42. */
  43. @property (nonatomic, copy, readonly) NSString *appkey;
  44. /*!
  45. * \~chinese
  46. * 控制台是否输出log, 默认为NO
  47. *
  48. * \~english
  49. * Whether print log to console, default is NO
  50. */
  51. @property (nonatomic, assign) BOOL enableConsoleLog;
  52. /*!
  53. * \~chinese
  54. * 日志输出级别, 默认为EMLogLevelDebug
  55. *
  56. * \~english
  57. * Log output level, default is EMLogLevelDebug
  58. */
  59. @property (nonatomic, assign) EMLogLevel logLevel;
  60. /*!
  61. * \~chinese
  62. * 是否只使用https, 默认为NO
  63. *
  64. * \~english
  65. * Whether using https only, default is NO
  66. */
  67. @property (nonatomic, assign) BOOL usingHttpsOnly;
  68. /*!
  69. * \~chinese
  70. * 是否自动登录, 默认为YES
  71. *
  72. * 只有在sdk初始化前设置有效。
  73. *
  74. * \~english
  75. * Whether auto login, default is YES
  76. *
  77. * The Settings are only valid before the SDK is initialized.
  78. */
  79. @property (nonatomic, assign) BOOL isAutoLogin;
  80. /*!
  81. * \~chinese
  82. * 离开群组时是否删除该群所有消息, 默认为YES
  83. *
  84. * \~english
  85. * Whether to delete all the group messages when leaving the group, default is YES
  86. */
  87. @property (nonatomic, assign) BOOL isDeleteMessagesWhenExitGroup;
  88. /*!
  89. * \~chinese
  90. * 离开聊天室时是否删除所有消息, 默认为YES
  91. *
  92. * \~english
  93. * Whether to delete all the chat room messages when leaving the chat room, default is YES
  94. */
  95. @property (nonatomic, assign) BOOL isDeleteMessagesWhenExitChatRoom;
  96. /*!
  97. * \~chinese
  98. * 是否允许聊天室Owner离开, 默认为YES
  99. *
  100. * \~english
  101. * if allow chat room's owner can leave the chat room, default is YES.
  102. */
  103. @property (nonatomic, assign) BOOL isChatroomOwnerLeaveAllowed;
  104. /*!
  105. * \~chinese
  106. * 用户自动同意群邀请, 默认为YES
  107. *
  108. * \~english
  109. * Whether to automatically accept group invitation, default is YES
  110. */
  111. @property (nonatomic, assign) BOOL isAutoAcceptGroupInvitation;
  112. /*!
  113. * \~chinese
  114. * 自动同意好友申请, 默认为NO
  115. *
  116. * \~english
  117. * Whether to automatically approve friend request, default is NO
  118. */
  119. @property (nonatomic, assign) BOOL isAutoAcceptFriendInvitation;
  120. /*!
  121. * \~chinese
  122. * 是否自动下载图片和视频缩略图及语音消息, 默认为YES
  123. *
  124. * \~english
  125. * Whether to automatically download thumbnail of image&video and audio, default is YES
  126. */
  127. @property (nonatomic, assign) BOOL isAutoDownloadThumbnail;
  128. /**
  129. * \~chinese
  130. * 是否需要消息接受方已读确认,缺省YES
  131. *
  132. * \~english
  133. * whether receive message read by receiving user event
  134. */
  135. @property (nonatomic, assign) BOOL enableRequireReadAck;
  136. /*!
  137. * \~chinese
  138. * 是否发送消息送达回执, 默认为NO,如果设置为YES,SDK收到单聊消息时会自动发送送达回执
  139. *
  140. * \~english
  141. * Whether to send delivery acknowledgement, default is NO. If set to YES, SDK will automatically send a delivery acknowledgement when receiving a chat message
  142. */
  143. @property (nonatomic, assign) BOOL enableDeliveryAck;
  144. /*!
  145. * \~chinese
  146. * 从数据库加载消息时是否按服务器时间排序,默认为YES,按服务器时间排序
  147. *
  148. * \~english
  149. * Whether to sort messages by server received time when loading message from database, default is YES.
  150. */
  151. @property (nonatomic, assign) BOOL sortMessageByServerTime;
  152. /*!
  153. * \~chinese
  154. * 是否自动上传或者下载消息中的附件,默认为YES
  155. *
  156. * \~english
  157. * Whether to automatically upload or download the attachment in the message, default is YES.
  158. */
  159. @property (nonatomic, assign) BOOL isAutoTransferMessageAttachments;
  160. @property (nonatomic, assign) BOOL isUseRtcConfig;
  161. /*!
  162. * \~chinese
  163. * iOS特有属性,推送证书的名称
  164. *
  165. * 只能在[EMClient initializeSDKWithOptions:]时设置,不能在程序运行过程中动态修改
  166. *
  167. * \~english
  168. * Certificate name of Apple Push Notification Service
  169. *
  170. * Can only be set when initializing the SDK with [EMClient initializeSDKWithOptions:], can't be altered in runtime.
  171. */
  172. @property (nonatomic, copy) NSString *apnsCertName;
  173. /*!
  174. * \~chinese
  175. * iOS特有属性,PushKit证书名称
  176. *
  177. * 只能在[EMClient initializeSDKWithOptions:]时设置,不能在程序运行过程中动态修改
  178. *
  179. * \~english
  180. * Certificate name of Apple PushKit Service
  181. *
  182. * Can only be set when initializing the SDK with [EMClient initializeSDKWithOptions:], can't be altered in runtime.
  183. */
  184. @property (nonatomic, copy) NSString *pushKitCertName;
  185. /*!
  186. * \~chinese
  187. * 获取实例
  188. *
  189. * @param aAppkey App的appkey
  190. *
  191. * @result SDK设置项实例
  192. *
  193. * \~english
  194. * Get a SDK setting options instance
  195. *
  196. * @param aAppkey App‘s unique identifier
  197. *
  198. * @result SDK’s setting options instance
  199. */
  200. + (instancetype)optionsWithAppkey:(NSString *)aAppkey;
  201. #pragma mark - EM_DEPRECATED_IOS 3.2.3
  202. /*!
  203. * \~chinese
  204. * 是否使用开发环境, 默认为NO
  205. *
  206. * 只能在[EMClient initializeSDKWithOptions:]时设置,不能在程序运行过程中动态修改
  207. *
  208. * \~english
  209. * Whether using development environment, default is NO
  210. *
  211. * Can only be set when initializing the sdk with [EMClient initializeSDKWithOptions:], can't be altered in runtime.
  212. */
  213. @property (nonatomic, assign) BOOL isSandboxMode EM_DEPRECATED_IOS(3_0_0, 3_2_2);
  214. #pragma mark - EM_DEPRECATED_IOS 3.2.2
  215. /*!
  216. * \~chinese
  217. * 是否使用https, 默认为YES
  218. *
  219. * \~english
  220. * Whether using https, default is YES
  221. */
  222. @property (nonatomic, assign) BOOL usingHttps EM_DEPRECATED_IOS(3_0_0, 3_2_1);
  223. @end