NIMSDKHeader.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. //
  2. // NIMSDKHeaders.h
  3. // NIMLib
  4. //
  5. // Created by Netease.
  6. // Copyright (c) 2015 Netease. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @class NIMSDKOption;
  11. @class NIMServerSetting;
  12. /**
  13. * 压缩日志回调
  14. *
  15. * @param error 执行结果,如果成功 error 为 nil
  16. * @param path 压缩包的路径,只有当执行成功才有值,否则为 nil
  17. */
  18. typedef void(^NIMArchiveLogsHandler)(NSError *error, NSString *path);
  19. /**
  20. * NIMSDK
  21. */
  22. @interface NIMSDK : NSObject
  23. /**
  24. * 获取SDK实例
  25. *
  26. * @return NIMSDK实例
  27. */
  28. + (instancetype)sharedSDK;
  29. /**
  30. * 获取SDK版本号
  31. *
  32. * @return SDK版本号
  33. */
  34. - (NSString *)sdkVersion;
  35. /**
  36. * 初始化SDK
  37. *
  38. * @param appKey 申请的appKey
  39. * @param cerName 推送证书名
  40. * @discussion 如果需要更多注册选项,推荐使用 registerWithOption:
  41. */
  42. - (void)registerWithAppID:(NSString *)appKey
  43. cerName:(nullable NSString *)cerName;
  44. /**
  45. * 初始化SDK
  46. *
  47. * @param option 注册选项
  48. */
  49. - (void)registerWithOption:(NIMSDKOption *)option;
  50. /**
  51. * 获取AppKey
  52. *
  53. * @return 返回当前注册的AppKey
  54. */
  55. - (nullable NSString *)appKey;
  56. /**
  57. * 是否正在使用Demo AppKey
  58. *
  59. * @return 返回是否正在使用Demo AppKey
  60. */
  61. - (BOOL)isUsingDemoAppKey;
  62. /**
  63. * 更新APNS Token
  64. *
  65. * @param token APNS Token
  66. */
  67. - (void)updateApnsToken:(NSData *)token;
  68. /**
  69. * 更新APNS Token
  70. *
  71. * @param token APNS Token
  72. * @param key 自定义本端推送内容, 设置key可对应业务服务器自定义推送文案; 传@"" 清空配置, nil 则不更改
  73. */
  74. - (void)updateApnsToken:(NSData *)token
  75. customContentKey:(nullable NSString *)key;
  76. /**
  77. * 更新 PushKit Token
  78. *
  79. * @param token PushKit token
  80. * @discussion 目前仅支持 PKPushTypeVoIP
  81. */
  82. - (void)updatePushKitToken:(NSData *)token;
  83. /**
  84. * 获得SDK Log路径
  85. *
  86. * @return SDK当天log路径
  87. * @discussion 这个接口会返回当前最新的一个 log 文件路径,SDK 会每天生成一个 log 文件方便开发者定位和反馈问题
  88. */
  89. - (NSString *)currentLogFilepath;
  90. /**
  91. * 打包当前的日志集合
  92. *
  93. * @param completion 打包后的压缩包路径
  94. * @discussion 这个接口会压缩当前所有的日志为 Zip 文件,并输出 Zip 路径,上层可以根据这个文件进行上传反馈
  95. */
  96. - (void)archiveLogs:(NIMArchiveLogsHandler)completion;
  97. /**
  98. * 开启控制台Log
  99. */
  100. - (void)enableConsoleLog;
  101. /**
  102. * 当前服务器配置
  103. * @discussion 私有化需要进行自定义设置,必须在注册 appkey 完成之前设置
  104. */
  105. @property (nonatomic,strong) NIMServerSetting *serverSetting;
  106. /**
  107. * 资源场景配置
  108. * @discussion nos 预设场景和自定义场景规则
  109. * 可以覆盖设置,如果预设场景不设置,为系统默认设置
  110. * sceneDict key-value,系统默认预设场景为3种,自定义场景不超过10种
  111. * key 是场景,nsstring类型;value 是资源存活时间,nsnumber类型,精确到天,0为永久存活
  112. * 例如:@{@"nim_icon":@0,@"nim_msg":@0,@"nim_system":@0,@"nim_custom":@30}
  113. */
  114. @property (nonatomic,strong) NSMutableDictionary *sceneDict;
  115. /**
  116. * 登录管理类 负责登录,注销和相关操作的通知收发
  117. */
  118. @property (nonatomic,strong,readonly) id<NIMLoginManager> loginManager;
  119. /**
  120. * 聊天管理类,负责消息的收发
  121. */
  122. @property (nonatomic,strong,readonly) id<NIMChatManager> chatManager;
  123. /**
  124. * 会话管理类,负责消息,最近会话的读写和管理
  125. */
  126. @property (nonatomic,strong,readonly) id<NIMConversationManager> conversationManager;
  127. /**
  128. * 媒体管理类,负责多媒体相关的接口 (录音等)
  129. */
  130. @property (nonatomic,strong,readonly) id<NIMMediaManager> mediaManager;
  131. /**
  132. * 群组管理类,负责群组的操作:创建,拉人,踢人,同步等
  133. */
  134. @property (nonatomic,strong,readonly) id<NIMTeamManager> teamManager;
  135. /**
  136. * 超大群,负责超大群的相关操作
  137. */
  138. @property (nonatomic,strong,readonly) id<NIMSuperTeamManager> superTeamManager;
  139. /**
  140. * 好友管理类
  141. */
  142. @property (nonatomic,strong,readonly) id<NIMUserManager> userManager;
  143. /**
  144. * 系统通知管理类
  145. */
  146. @property (nonatomic,strong,readonly) id<NIMSystemNotificationManager> systemNotificationManager;
  147. /**
  148. * APNS推送管理类
  149. */
  150. @property (nonatomic,strong,readonly) id<NIMApnsManager> apnsManager;
  151. /**
  152. * 资源管理器,负责文件上传和下载
  153. */
  154. @property (nonatomic,strong,readonly) id<NIMResourceManager> resourceManager;
  155. /**
  156. * 聊天室管理类
  157. */
  158. @property (nonatomic,strong,readonly) id<NIMChatroomManager> chatroomManager;
  159. /**
  160. * 文档转码管理类
  161. */
  162. @property (nonatomic,strong,readonly) id<NIMDocTranscodingManager> docTranscodingManager;
  163. /**
  164. * 事件订阅管理类
  165. */
  166. @property (nonatomic,strong,readonly) id<NIMEventSubscribeManager> subscribeManager;
  167. /**
  168. * 智能机器人管理类
  169. */
  170. @property (nonatomic,strong,readonly) id<NIMRobotManager> robotManager;
  171. /**
  172. * 红包管理类
  173. */
  174. @property (nonatomic,strong,readonly) id<NIMRedPacketManager> redPacketManager;
  175. /**
  176. * 广播消息管理类
  177. */
  178. @property (nonatomic,strong,readonly) id<NIMBroadcastManager> broadcastManager;
  179. /**
  180. * 反垃圾管理类
  181. */
  182. @property (nonatomic,strong,readonly) id<NIMAntispamManager> antispamManager;
  183. /**
  184. * 通用音视频信令管理类
  185. */
  186. @property (nonatomic,strong,readonly) id<NIMSignalManager> signalManager;
  187. /**
  188. * 透传代理管理类
  189. */
  190. @property (nonatomic,strong,readonly) id<NIMPassThroughManager> passThroughManager;
  191. @end
  192. NS_ASSUME_NONNULL_END