|
NERTCCallkit iOS API
V1.8.0
|
类方法 | |
| (instancetype) | + sharedInstance |
| 单例 | |
| (NSString *) | + versionCode |
| 版本号 | |
属性 | |
| NERtcCallStatus | callStatus |
| 通话状态 | |
| NSTimeInterval | timeOutSeconds |
| 单位:秒,IM服务器邀请2分钟后无响应为超时,最大值不超过2分钟。 | |
| NERtcCallKitTokenHandler | tokenHandler |
| 安全模式音视频房间token获取,nil表示非安全模式. Block中一定要调用complete | |
| NERtcCallKitPushConfigHandler | pushConfigHandler |
| 推送配置定制化,修改config.pushTitle,config.pushContent来完成。需要的上下文内容在context对象中提供。 | |
| id< NERtcEngineDelegateEx > | engineDelegate |
| id< NERtcEngineMediaStatsObserver > | observer |
| 中转NERtcEngine统计回调 | |
| - (void) accept: | (nullable void(^)(NSError *_Nullable error)) | completion |
接受呼叫
| completion | 回调 |
| - (void) acceptWithToken: | (nullable NSString *) | token | |
| withCompletion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
接受呼叫
| token | 用户token,如果用户直接传入,不需要实现 tokenHandler block回调 |
| completion | 回调 |
| - (void) addDelegate: | (id< NERtcCallKitDelegate >) | delegate |
添加代理 接受回调
| delegate | 代理对象 |
| - (void) call: | (NSString *) | userID | |
| type: | (NERtcCallType) | type | |
| attachment: | (nullable NSString *) | attachment | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
开始呼叫
| userID | 呼叫的用户ID |
| type | 通话类型 => NERtcCallType |
| attachment | 附件信息,透传到onInvited |
| completion | 回调 |
| - (void) call: | (NSString *) | userID | |
| type: | (NERtcCallType) | type | |
| attachment: | (nullable NSString *) | attachment | |
| globalExtra: | (nullable NSString *) | extra | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
开始呼叫
| userID | 呼叫的用户ID |
| type | 通话类型 => NERtcCallType |
| attachment | 附件信息,透传到onInvited |
| extra | 扩展 |
| completion | 回调 |
| - (void) call: | (NSString *) | userID | |
| type: | (NERtcCallType) | type | |
| attachment: | (nullable NSString *) | attachment | |
| globalExtra: | (nullable NSString *) | extra | |
| withToken: | (nullable NSString *) | token | |
| channelName: | (nullable NSString *) | channelName | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
开始呼叫
| userID | 呼叫的用户ID |
| type | 通话类型 => NERtcCallType |
| attachment | 附件信息,透传到onInvited |
| extra | 全局抄送 |
| token | 安全模式token,如果用户直接传入,不需要实现 tokenHandler block回调 |
| channelName | 自定义channelName,不传会默认生成 |
| completion | 回调 |
| - (void) call: | (NSString *) | userID | |
| type: | (NERtcCallType) | type | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
开始呼叫
| userID | 呼叫的用户ID |
| type | 通话类型 |
| completion | 回调 |
| - (void) cancel: | (nullable void(^)(NSError *_Nullable error)) | completion |
取消呼叫
| completion | 回调 |
| - (int) enableLocalVideo: | (BOOL) | enable |
启动或关闭摄像头
| enable | YES:启动,NO:关闭 |
| - (void) enableSwitchCallTypeConfirmVideo: | (BOOL) | video | |
| audio: | (BOOL) | audio | |
音视频切换是否需要确认配置
| video | 切换到视频是否需要确认 |
| audio | 切换到音频是否需要确认 |
| - (void) groupCall: | (NSArray< NSString * > *) | userIDs | |
| groupID: | (nullable NSString *) | groupID | |
| type: | (NERtcCallType) | type | |
| attachment: | (nullable NSString *) | attachment | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
多人呼叫
| userIDs | 呼叫的用户ID数组 (不包含自己) |
| type | 通话类型 |
| attachment | 附件信息,透传到onInvited |
| completion | 回调 |
| - (void) groupCall: | (NSArray< NSString * > *) | userIDs | |
| groupID: | (nullable NSString *) | groupID | |
| type: | (NERtcCallType) | type | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
多人呼叫
| userIDs | 呼叫的用户ID数组 (不包含自己) |
| type | 通话类型 |
| completion | 回调 |
| - (void) groupInvite: | (NSArray< NSString * > *) | userIDs | |
| groupID: | (nullable NSString *) | groupID | |
| attachment: | (nullable NSString *) | attachment | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
呼叫过程中邀请用户加入(仅限群呼)
| userIDs | 呼叫的用户ID数组 (不包含自己) |
| attachment | 附件信息,透传到onInvited |
| completion | 回调 |
| - (void) groupInvite: | (NSArray< NSString * > *) | userIDs | |
| groupID: | (nullable NSString *) | groupID | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
呼叫过程中邀请用户加入(仅限群呼)
| userIDs | 呼叫的用户ID数组 (不包含自己) |
| completion | 回调 |
| - (void) hangup: | (nullable void(^)(NSError *_Nullable error)) | completion |
挂断
| completion | 回调 |
| - (void) leave: | (nullable void(^)(NSError *_Nullable error)) | completion |
离开,不挂断
| completion | 回调 |
| - (void) login: | (NSString *) | userID | |
| token: | (NSString *) | token | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
登录IM接口,所有功能需要先进行登录后才能使用
| userID | IM用户accid |
| token | IM用户token |
| completion | 回调 |
| - (void) memberOfAccid: | (NSString *) | accid | |
| completion: | (nullable void(^)(NIMSignalingMemberInfo *_Nullable info)) | completion | |
根据uid 获取 accid
| accid | IM 用户id @discussion 只有在通话中才能通过accid获取获取uid |
| - (void) memberOfUid: | (uint64_t) | uid | |
| completion: | (nullable void(^)(NIMSignalingMemberInfo *_Nullable info)) | completion | |
根据uid 获取 accid
| uid | 用户id @discussion 只有在通话中才能通过uid获取accid |
| - (int) muteLocalAudio: | (BOOL) | mute |
麦克风静音
| mute | YES:静音 NO:开启 |
| - (int) muteLocalVideo: | (BOOL) | muted |
开启或关闭视频采集
| muted | YES:关闭,NO:开启 |
| - (void) reject: | (nullable void(^)(NSError *_Nullable error)) | completion |
拒绝呼叫
| completion | 回调 |
| - (void) rejectWithReason: | (NSInteger) | reason | |
| withCompletion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
拒绝呼叫
| completion | 回调 |
| reason | 挂断原因 |
| - (void) removeDelegate: | (id< NERtcCallKitDelegate >) | delegate |
移除代理
| delegate | 代理对象 |
| - (void) setAudioMute: | (BOOL) | mute | |
| forUser: | (NSString *) | userID | |
| error: | (NSError *_Nonnull *_Nonnull) | error | |
指定对某个用户静音。
| mute | 是否静音 |
| userID | 用户ID |
| error | 错误,成功为nil @discussion 只能不接收指定用户的音频,并不影响房间中其他人接受该用户的音频 |
| - (void) setLoudSpeakerMode: | (BOOL) | speaker | |
| error: | (NSError *_Nonnull *_Nonnull) | error | |
是否使用扬声器模式
| speaker | YES:扬声器 NO:听筒 |
| error | 错误,成功为nil |
| - (void) setupAppKey: | (NSString *) | appKey | |
| options: | (nullable NERtcCallOptions *) | options | |
初始化,所有功能需要先初始化
| appKey | 云信后台注册的appKey |
| - (void) setupAppKey: | (NSString *) | appKey | |
| options: | (nullable NERtcCallOptions *) | options | |
| withContext: | (nonnull NERtcEngineContext *) | context | |
初始化,所有功能需要先初始化,支持私有化
| appKey | 云信后台注册的appKey |
| options | IM 推送配置,Rtc是否初始化 |
| context | Rtc初始化配置,私有化参数配置 |
| - (void) setupAppKey: | (NSString *) | appKey | |
| withRtcUid: | (uint64_t) | rtcUid | |
| options: | (nullable NERtcCallOptions *) | options | |
初始化,所有功能需要先初始化
| appKey | 云信后台注册的appKey |
| rtcUid | 用户自定义rtc uid,如果不需要自定义传入 <= 0 任意整数(或者使用- (void)setupAppKey:(NSString *)appKey options:(nullable NERtcCallOptions *)options 初始化接口),内部自动生成,如果初始化传入会优先使用外部传入 |
| - (void) setupLocalView: | (nullable UIView *) | localView |
设置自己画面
| localView | 渲染自己画面的View @discussion localView上不建议有任何subview |
| - (void) setupRemoteView: | (nullable UIView *) | remoteView | |
| forUser: | (NSString *) | userID | |
设置其他用户画面
| remoteView | 渲染其他画面的View |
| userID | 其他用户ID @discussion remoteView上不建议有任何subview |
| - (void) switchCallType: | (NERtcCallType) | type | |
| withState: | (NERtcSwitchState) | state | |
| completion: | (nullable void(^)(NSError *_Nullable error)) | completion | |
在通话过程中切换通话类型。非通话过程中调用无效。仅支持1对1通话。
| type | 通话类型: 音频/视频 |
| state | 切换应答类型: 邀请/同意/拒绝 |
| completion | 回调 @discussion 切换完成后,组件内部会将己端和对端调用-enableLocalVideo:,此时外部不建议再调用-enableLocalVideo:,防止状态错乱. |
| - (int) switchCamera |
切换摄像头
| - (void) updateApnsToken: | (NSData *) | deviceToken |
更新APNS deviceToken
| deviceToken | 注册获得的deviceToken |
| - (void) updatePushKitToken: | (NSData *) | pushkitToken |
更新 PushKit Token
| pushkitToken | 目前仅支持 PKPushTypeVoIP |
|
readwritenonatomicweak |
NERtcEngine 的回调接口,由用户提供