| 
    JRTCSDK-iOS v2302.0
    
   视频客服 API 文档 
   | 
 
构造函数 | |
| (void) | - onLogin:reason: | 
| (void) | - onLogout: | 
| (void) | - onClientStateChanged:oldState: | 
| (void) | - onOnlineMessageSendResult:operatorId: | 
| (void) | - onOnlineMessageReceived:userId: | 
| (void) | - onSDKEvent: | 
| (void) | - onP2PSessionCreate:result: | 
| (void) | - onP2PSessionConnect:result: | 
| (void) | - onP2PSessionClose: | 
| (void) | - onP2PMessageReceived:receiveMsg: | 
| (void) | - onGetUploadUrlResponse:token:url:fileId:offset: | 
| (void) | - onRequestFileUploadInfoResponse:result:url:token:requestTimestamp:extraInfo:fileSize:offset:fileType:serverOid:reason: | 
| (void) | - onCompleteFileUploadResponse:result:fileName:extraInfo:fileType:reason: | 
| (void) | - onGetUploadFileInfoResponse:result:uploadFileInfoArray:extraInfo:reason: | 
| - (void) onClientStateChanged: | (JRTCClientState) | state | |
| oldState: | (JRTCClientState) | oldState | |
登录状态变化通知
| state | 当前状态值 | 
| oldState | 之前状态值 | 
| - (void) onCompleteFileUploadResponse: | (int) | operatorId | |
| result: | (BOOL) | result | |
| fileName: | (NSString *) | fileName | |
| extraInfo: | (NSString *) | extraInfo | |
| fileType: | (NSString *) | fileType | |
| reason: | (NSString *) | reason | |
文件上传完成确认响应
| operatorId | 操作id,对应 completeFileUpload 的返回值  | 
| result | 请求是否成功
  | 
| fileName | 服务器合并后的文件名 | 
| extraInfo | 随路参数 | 
| fileType | 文件类型 | 
| reason | 请求失败原因描述,当 result 为 false 时有效 | 
| - (void) onGetUploadFileInfoResponse: | (int) | operatorId | |
| result: | (bool) | result | |
| uploadFileInfoArray: | (NSArray< JRTCUploadFileInfo * > *) | uploadFileInfoArray | |
| extraInfo: | (NSString *) | extraInfo | |
| reason: | (NSString *) | reason | |
获取上传文件信息列表响应
| operatorId | 操作id,对应 getUploadFileInfo 的返回值  | 
| result | 请求是否成功
  | 
| uploadFileInfoList | 文件信息对象列表,当 result 为 true 时有效 | 
| extraInfo | 随路参数,当 result 为 true 时有效 | 
| reason | 请求失败原因描述,当 result 为 false 时有效 | 
| - (void) onGetUploadUrlResponse: | (bool) | result | |
| token: | (NSString *) | token | |
| url: | (NSString *) | url | |
| fileId: | (NSString *) | fileId | |
| offset: | (long) | offset | |
获取文件上传地址等信息回调
通话中访客可调用 getUploadUrl 接口获取文件上传的地址等信息,具体信息通过此回调获取。 
getUploadUrl 接口,然后通过此回调的信息再上传至服务器。 | result | 获取结果,true 表示获取成功,false 表示获取失败 | 
| token | 校验用的token | 
| url | 文件上传地址 | 
| fileId | 文件ID | 
| offset | 文件续传位置 | 
| - (void) onLogin: | (bool) | result | |
| reason: | (ReasonCode) | reason | |
登录结果回调
| result | true 表示登录成功,false 表示登录失败 | 
| reason | 当 result 为 false 时该值有效 | 
| - (void) onLogout: | (ReasonCode) | reason | 
登出回调
| reason | 登出原因 | 
| - (void) onOnlineMessageReceived: | (NSString *) | message | |
| userId: | (NSString *) | userId | |
收到在线消息回调
| message | 消息内容 | 
| userId | 对方userId | 
| - (void) onOnlineMessageSendResult: | (bool) | result | |
| operatorId: | (int) | operatorId | |
在线消息发送结果回调
| result | 发送结果是否成功
  | 
| operatorId | 操作ID,对应 sendOnlineMessage 的返回值  | 
| - (void) onP2PMessageReceived: | (JRTCP2PSession *) | session | |
| receiveMsg: | (NSString *) | receiveMsg | |
P2P通道收到消息回调
| session | P2P通道对象 | 
| receiveMsg | 消息内容 | 
| - (void) onP2PSessionClose: | (JRTCP2PSession *) | session | 
P2P通道关闭回调
| session | P2P通道对象 | 
| - (void) onP2PSessionConnect: | (JRTCP2PSession *) | session | |
| result: | (bool) | result | |
P2P通道连接结果回调
| session | P2P通道对象 | 
| result | P2P通道连接结果
  | 
| - (void) onP2PSessionCreate: | (JRTCP2PSession *) | session | |
| result: | (bool) | result | |
P2P通道创建实例回调
| session | P2P通道对象 | 
| result | 创建P2P通道结果
  | 
| - (void) onRequestFileUploadInfoResponse: | (int) | operatorId | |
| result: | (bool) | result | |
| url: | (NSString *) | url | |
| token: | (NSString *) | token | |
| requestTimestamp: | (long) | requestTimestamp | |
| extraInfo: | (NSString *) | extraInfo | |
| fileSize: | (long) | fileSize | |
| offset: | (int) | offset | |
| fileType: | (NSString *) | fileType | |
| serverOid: | (NSString *) | serverOid | |
| reason: | (NSString *) | reason | |
获取文件上传或断点续传信息响应
| operatorId | 操作id,对应 requestFileUploadInfo 的返回值  | 
| result | 请求是否成功
  | 
| url | 上传地址,分片录制文件上传场景,首次请求分片上传信息时有效 | 
| token | 文件上传所需token,用于校验上传合法性,需要在上传文件的时候携带 | 
| requestTimestamp | 本次请求发起时间戳,用于控制上传地址有效期,需要在上传文件的时候携带 | 
| extraInfo | 随路参数 | 
| fileSize | 文件大小 | 
| offset | 偏移量 | 
| fileType | 文件类型 | 
| serverOid | 上传目标服务Oid | 
| reason | 请求失败原因描述,当 result 为 false 时有效 | 
| - (void) onSDKEvent: | (JRTCSDKEvent *) | event | 
上报事件回调
| event | 事件对象 |