NIMSDK Class Reference

Inherits from NSObject
Declared in NIMSDKHeader.h

Overview

NIMSDK

+ sharedSDK

获取SDK实例

+ (instancetype)sharedSDK

Return Value

NIMSDK实例

Discussion

获取SDK实例

Declared In

NIMSDKHeader.h

– sdkVersion

获取SDK版本号

- (NSString *)sdkVersion

Return Value

SDK版本号

Discussion

获取SDK版本号

Declared In

NIMSDKHeader.h

– registerWithAppID:cerName:

初始化SDK

- (void)registerWithAppID:(NSString *)appKey cerName:(nullable NSString *)cerName

Parameters

appKey

申请的appKey

cerName

推送证书名

Discussion

初始化SDK

如果需要更多注册选项,推荐使用 registerWithOption:

Declared In

NIMSDKHeader.h

– registerWithOption:

初始化SDK

- (void)registerWithOption:(NIMSDKOption *)option

Parameters

option

注册选项

Discussion

初始化SDK

Declared In

NIMSDKHeader.h

– appKey

获取AppKey

- (nullable NSString *)appKey

Return Value

返回当前注册的AppKey

Discussion

获取AppKey

Declared In

NIMSDKHeader.h

– isUsingDemoAppKey

是否正在使用Demo AppKey

- (BOOL)isUsingDemoAppKey

Return Value

返回是否正在使用Demo AppKey

Discussion

是否正在使用Demo AppKey

Declared In

NIMSDKHeader.h

– qchatWithOption:

设置圈组选项

- (void)qchatWithOption:(NIMQChatOption *)option

Parameters

option

圈组选项

Discussion

设置圈组选项

Declared In

NIMSDKHeader.h

– updateApnsToken:

更新APNS Token

- (NSString *)updateApnsToken:(NSData *)token

Parameters

token

APNS Token

Return Value

格式化后的APNS Token

Discussion

更新APNS Token

Declared In

NIMSDKHeader.h

– updateApnsToken:customContentKey:

更新APNS Token

- (NSString *)updateApnsToken:(NSData *)token customContentKey:(nullable NSString *)key

Parameters

token

APNS Token

key

自定义本端推送内容, 设置key可对应业务服务器自定义推送文案; 传@“” 清空配置, nil 则不更改

Return Value

格式化后的APNS Token

Discussion

更新APNS Token

Declared In

NIMSDKHeader.h

– updateApnsToken:customContentKey:qchatCustomContentKey:

更新APNS Token

- (NSString *)updateApnsToken:(NSData *)token customContentKey:(nullable NSString *)key qchatCustomContentKey:(nullable NSString *)qchatKey

Parameters

token

APNS Token

key

自定义本端推送内容, 设置key可对应业务服务器自定义推送文案; 传@“” 清空配置, nil 则不更改

qchatKey

自定义圈组本端推送内容, 设置key可对应业务服务器自定义推送文案; 传@“” 清空配置, nil 则不更改

Return Value

格式化后的APNS Token

Discussion

更新APNS Token

Declared In

NIMSDKHeader.h

– updatePushKitToken:

x 更新 PushKit Token

- (void)updatePushKitToken:(NSData *)token

Parameters

token

PushKit token

Discussion

x 更新 PushKit Token

目前仅支持 PKPushTypeVoIP

Declared In

NIMSDKHeader.h

– currentLogFilepath

获得SDK Log路径

- (NSString *)currentLogFilepath

Return Value

SDK当天log路径

Discussion

获得SDK Log路径

这个接口会返回当前最新的一个 log 文件路径,SDK 会每天生成一个 log 文件方便开发者定位和反馈问题

Declared In

NIMSDKHeader.h

– archiveLogs:

打包当前的日志集合

- (void)archiveLogs:(NIMArchiveLogsHandler)completion

Parameters

completion

打包后的压缩包路径

Discussion

打包当前的日志集合

这个接口会压缩当前所有的日志为 Zip 文件,并输出 Zip 路径,上层可以根据这个文件进行上传反馈

Declared In

NIMSDKHeader.h

– uploadLogs:

打包并上传当前的日志集合

- (void)uploadLogs:(NIMUploadLogsHandler _Nullable)completion

Parameters

completion

打包后的压缩包路径

Discussion

打包并上传当前的日志集合

这个接口会压缩当前所有的日志为 Zip 文件,并输出 Zip 路径,上层可以根据这个文件进行上传反馈

Declared In

NIMSDKHeader.h

– uploadLogsWithAttach:roomId:completion:

打包并上传当前的日志集合

- (void)uploadLogsWithAttach:(nullable NSString *)attach roomId:(nullable NSString *)roomId completion:(NIMUploadLogsHandler _Nullable)completion

Parameters

attach

附言,可为空

roomId

聊天室ID,可为空

completion

打包后的压缩包路径

Discussion

打包并上传当前的日志集合

这个接口会压缩当前所有的日志为 Zip 文件,并输出 Zip 路径,上层可以根据这个文件进行上传反馈

Declared In

NIMSDKHeader.h

– optimizeQChat

优化圈组表现

- (void)optimizeQChat

Discussion

优化圈组表现

Declared In

NIMSDKHeader.h

– enableConsoleLog

开启控制台Log

- (void)enableConsoleLog

Discussion

开启控制台Log

Declared In

NIMSDKHeader.h

  serverSetting

当前服务器配置

@property (nonatomic, strong) NIMServerSetting *serverSetting

Discussion

当前服务器配置

私有化需要进行自定义设置,必须在注册 appkey 完成之前设置

Declared In

NIMSDKHeader.h

  sceneDict

资源场景配置

@property (nonatomic, strong) NSMutableDictionary *sceneDict

Discussion

资源场景配置

nos 预设场景和自定义场景规则 可以覆盖设置,如果预设场景不设置,为系统默认设置 sceneDict key-value,系统默认预设场景为3种,自定义场景不超过10种 key 是场景,nsstring类型;value 是资源存活时间,nsnumber类型,精确到天,0为永久存活 例如:@{@“nim_icon”:@0,@“nim_msg”:@0,@“nim_system”:@0,@“nim_custom”:@30}

Declared In

NIMSDKHeader.h

  loginManager

登录管理类 负责登录,注销和相关操作的通知收发

@property (nonatomic, strong, readonly) id<NIMLoginManager> loginManager

Discussion

登录管理类 负责登录,注销和相关操作的通知收发

Declared In

NIMSDKHeader.h

  chatManager

聊天管理类,负责消息的收发

@property (nonatomic, strong, readonly) id<NIMChatManager> chatManager

Discussion

聊天管理类,负责消息的收发

Declared In

NIMSDKHeader.h

  conversationManager

会话管理类,负责消息,最近会话的读写和管理

@property (nonatomic, strong, readonly) id<NIMConversationManager> conversationManager

Discussion

会话管理类,负责消息,最近会话的读写和管理

Declared In

NIMSDKHeader.h

  mediaManager

媒体管理类,负责多媒体相关的接口 (录音等)

@property (nonatomic, strong, readonly) id<NIMMediaManager> mediaManager

Discussion

媒体管理类,负责多媒体相关的接口 (录音等)

Declared In

NIMSDKHeader.h

  teamManager

群组管理类,负责群组的操作:创建,拉人,踢人,同步等

@property (nonatomic, strong, readonly) id<NIMTeamManager> teamManager

Discussion

群组管理类,负责群组的操作:创建,拉人,踢人,同步等

Declared In

NIMSDKHeader.h

  superTeamManager

超大群,负责超大群的相关操作

@property (nonatomic, strong, readonly) id<NIMSuperTeamManager> superTeamManager

Discussion

超大群,负责超大群的相关操作

Declared In

NIMSDKHeader.h

  userManager

好友管理类

@property (nonatomic, strong, readonly) id<NIMUserManager> userManager

Discussion

好友管理类

Declared In

NIMSDKHeader.h

  systemNotificationManager

系统通知管理类

@property (nonatomic, strong, readonly) id<NIMSystemNotificationManager> systemNotificationManager

Discussion

系统通知管理类

Declared In

NIMSDKHeader.h

  apnsManager

APNS推送管理类

@property (nonatomic, strong, readonly) id<NIMApnsManager> apnsManager

Discussion

APNS推送管理类

Declared In

NIMSDKHeader.h

  resourceManager

资源管理器,负责文件上传和下载

@property (nonatomic, strong, readonly) id<NIMResourceManager> resourceManager

Discussion

资源管理器,负责文件上传和下载

Declared In

NIMSDKHeader.h

  chatroomManager

聊天室管理类

@property (nonatomic, strong, readonly) id<NIMChatroomManager> chatroomManager

Discussion

聊天室管理类

Declared In

NIMSDKHeader.h

  docTranscodingManager

文档转码管理类

@property (nonatomic, strong, readonly) id<NIMDocTranscodingManager> docTranscodingManager

Discussion

文档转码管理类

Declared In

NIMSDKHeader.h

  subscribeManager

事件订阅管理类

@property (nonatomic, strong, readonly) id<NIMEventSubscribeManager> subscribeManager

Discussion

事件订阅管理类

Declared In

NIMSDKHeader.h

  robotManager

智能机器人管理类

@property (nonatomic, strong, readonly) id<NIMRobotManager> robotManager

Discussion

智能机器人管理类

Declared In

NIMSDKHeader.h

  redPacketManager

红包管理类

@property (nonatomic, strong, readonly) id<NIMRedPacketManager> redPacketManager

Discussion

红包管理类

Declared In

NIMSDKHeader.h

  broadcastManager

广播消息管理类

@property (nonatomic, strong, readonly) id<NIMBroadcastManager> broadcastManager

Discussion

广播消息管理类

Declared In

NIMSDKHeader.h

  antispamManager

反垃圾管理类

@property (nonatomic, strong, readonly) id<NIMAntispamManager> antispamManager

Discussion

反垃圾管理类

Declared In

NIMSDKHeader.h

  signalManager

通用音视频信令管理类

@property (nonatomic, strong, readonly) id<NIMSignalManager> signalManager

Discussion

通用音视频信令管理类

Declared In

NIMSDKHeader.h

  passThroughManager

透传代理管理类

@property (nonatomic, strong, readonly) id<NIMPassThroughManager> passThroughManager

Discussion

透传代理管理类

Declared In

NIMSDKHeader.h

  chatExtendManager

Thread Talk管理类

@property (nonatomic, strong, readonly) id<NIMChatExtendManager> chatExtendManager

Discussion

Thread Talk管理类

Declared In

NIMSDKHeader.h

  indexManager

索引管理类

@property (nonatomic, strong, readonly) id<NIMIndexManager> indexManager

Discussion

索引管理类

Declared In

NIMSDKHeader.h

  qchatManager

圈组管理类

@property (nonatomic, strong, readonly) id<NIMQChatManager> qchatManager

Discussion

圈组管理类

Declared In

NIMSDKHeader.h

  qchatApnsManager

圈组APNS推送管理类

@property (nonatomic, strong, readonly) id<NIMQChatApnsManager> qchatApnsManager

Discussion

圈组APNS推送管理类

Declared In

NIMSDKHeader.h

  qchatServerManager

圈组服务器管理类

@property (nonatomic, strong, readonly) id<NIMQChatServerManager> qchatServerManager

Discussion

圈组服务器管理类

Declared In

NIMSDKHeader.h

  qchatChannelManager

圈组频道管理类

@property (nonatomic, strong, readonly) id<NIMQChatChannelManager> qchatChannelManager

Discussion

圈组频道管理类

Declared In

NIMSDKHeader.h

  qchatRoleManager

圈组身份组管理类

@property (nonatomic, strong, readonly) id<NIMQChatRoleManager> qchatRoleManager

Discussion

圈组身份组管理类

Declared In

NIMSDKHeader.h

  qchatMessageManager

圈组消息管理类

@property (nonatomic, strong, readonly) id<NIMQChatMessageManager> qchatMessageManager

Discussion

圈组消息管理类

Declared In

NIMSDKHeader.h

  qchatMessageExtendManager

圈组消息扩展管理类

@property (nonatomic, strong, readonly) id<NIMQChatMessageExtendManager> qchatMessageExtendManager

Discussion

圈组消息扩展管理类

Declared In

NIMSDKHeader.h

  qchatRTCChannelManager

圈组rtc管理类

@property (nonatomic, strong, readonly) id<NIMQChatRTCChannelManager> qchatRTCChannelManager

Discussion

圈组rtc管理类

Declared In

NIMSDKHeader.h