#include <NERtcCallKit.h>
◆ accept:
- (void) accept: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
|
◆ acceptWithToken:withCompletion:
- (void) acceptWithToken: |
|
(nullable NSString *) | token |
withCompletion: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
接受呼叫
- 参数
-
token | 用户token,如果用户直接传入,不需要实现 tokenHandler block回调 |
completion | 回调 |
◆ addDelegate:
◆ call:type:attachment:completion:
- (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 | 回调 |
◆ call:type:attachment:globalExtra: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 | 回调 |
◆ call:type:attachment:globalExtra:withToken:channelName: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 | 回调 |
◆ call:type:completion:
- (void) call: |
|
(NSString *) | userID |
type: |
|
(NERtcCallType) | type |
completion: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
开始呼叫
- 参数
-
userID | 呼叫的用户ID |
type | 通话类型 |
completion | 回调 |
◆ cancel:
- (void) cancel: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
|
◆ enableLocalVideo:
- (int) enableLocalVideo: |
|
(BOOL) | enable |
|
启动或关闭摄像头
- 参数
-
- 返回
- 操作返回值,成功则返回 0
◆ enableSwitchCallTypeConfirmVideo:audio:
- (void) enableSwitchCallTypeConfirmVideo: |
|
(BOOL) | video |
audio: |
|
(BOOL) | audio |
音视频切换是否需要确认配置
- 参数
-
video | 切换到视频是否需要确认 |
audio | 切换到音频是否需要确认 |
◆ hangup:
- (void) hangup: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
|
◆ login:token:completion:
- (void) login: |
|
(NSString *) | userID |
token: |
|
(NSString *) | token |
completion: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
登录IM接口,所有功能需要先进行登录后才能使用
- 参数
-
userID | IM用户accid |
token | IM用户token |
completion | 回调 |
◆ logout:
- (void) logout: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
|
◆ memberOfAccid:completion:
- (void) memberOfAccid: |
|
(NSString *) | accid |
completion: |
|
(nullable void(^)(NIMSignalingMemberInfo *_Nullable info)) | completion |
根据uid 获取 accid
- 参数
-
accid | IM 用户id @discussion 只有在通话中才能通过accid获取获取uid |
◆ memberOfUid:completion:
- (void) memberOfUid: |
|
(uint64_t) | uid |
completion: |
|
(nullable void(^)(NIMSignalingMemberInfo *_Nullable info)) | completion |
根据uid 获取 accid
- 参数
-
uid | 用户id @discussion 只有在通话中才能通过uid获取accid |
◆ muteLocalAudio:
- (int) muteLocalAudio: |
|
(BOOL) | mute |
|
◆ muteLocalVideo:
- (int) muteLocalVideo: |
|
(BOOL) | muted |
|
开启或关闭视频采集
- 参数
-
- 返回
- 操作返回值,成功则返回 0
◆ reject:
- (void) reject: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
|
◆ rejectWithReason:withCompletion:
- (void) rejectWithReason: |
|
(NSInteger) | reason |
withCompletion: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
◆ removeDelegate:
◆ setAudioMute:forUser:error:
- (void) setAudioMute: |
|
(BOOL) | mute |
forUser: |
|
(NSString *) | userID |
error: |
|
(NSError *_Nonnull *_Nonnull) | error |
指定对某个用户静音。
- 参数
-
mute | 是否静音 |
userID | 用户ID |
error | 错误,成功为nil @discussion 只能不接收指定用户的音频,并不影响房间中其他人接受该用户的音频 |
◆ setLoudSpeakerMode:error:
- (void) setLoudSpeakerMode: |
|
(BOOL) | speaker |
error: |
|
(NSError *_Nonnull *_Nonnull) | error |
是否使用扬声器模式
- 参数
-
speaker | YES:扬声器 NO:听筒 |
error | 错误,成功为nil |
◆ setupAppKey:options:
- (void) setupAppKey: |
|
(NSString *) | appKey |
options: |
|
(nullable NERtcCallOptions *) | options |
◆ setupAppKey:options:withContext:
- (void) setupAppKey: |
|
(NSString *) | appKey |
options: |
|
(nullable NERtcCallOptions *) | options |
withContext: |
|
(nonnull NERtcEngineContext *) | context |
初始化,所有功能需要先初始化,支持私有化
- 参数
-
appKey | 云信后台注册的appKey |
options | IM 推送配置,Rtc是否初始化 |
context | Rtc初始化配置,私有化参数配置 |
◆ setupAppKey:withRtcUid:options:
- (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 初始化接口),内部自动生成,如果初始化传入会优先使用外部传入 |
◆ setupLocalView:
- (void) setupLocalView: |
|
(nullable UIView *) | localView |
|
设置自己画面
- 参数
-
localView | 渲染自己画面的View @discussion localView上不建议有任何subview |
◆ setupRemoteView:forUser:
- (void) setupRemoteView: |
|
(nullable UIView *) | remoteView |
forUser: |
|
(nullable NSString *) | userID |
设置其他用户画面
- 参数
-
remoteView | 渲染其他画面的View |
userID | 其他用户ID @discussion remoteView上不建议有任何subview |
◆ sharedInstance
+ (instancetype) sharedInstance |
|
|
|
◆ switchCallType:withState:completion:
- (void) switchCallType: |
|
(NERtcCallType) | type |
withState: |
|
(NERtcSwitchState) | state |
completion: |
|
(nullable void(^)(NSError *_Nullable error)) | completion |
在通话过程中切换通话类型。非通话过程中调用无效。仅支持1对1通话。
- 参数
-
type | 通话类型: 音频/视频 |
state | 切换应答类型: 邀请/同意/拒绝 |
completion | 回调 @discussion 切换完成后,组件内部会将己端和对端调用-enableLocalVideo:,此时外部不建议再调用-enableLocalVideo:,防止状态错乱. |
◆ switchCamera
◆ updateApnsToken:
- (void) updateApnsToken: |
|
(NSData *) | deviceToken |
|
更新APNS deviceToken
- 参数
-
deviceToken | 注册获得的deviceToken |
◆ updatePushKitToken:
- (void) updatePushKitToken: |
|
(NSData *) | pushkitToken |
|
更新 PushKit Token
- 参数
-
pushkitToken | 目前仅支持 PKPushTypeVoIP |
◆ versionCode
+ (NSString *) versionCode |
|
|
|
◆ callStatus
◆ engineDelegate
- (id<NERtcEngineDelegateEx>) engineDelegate |
|
readwritenonatomicweak |
◆ observer
- (id<NERtcEngineMediaStatsObserver>) observer |
|
readwritenonatomicweak |
◆ pushConfigHandler
推送配置定制化,修改config.pushTitle,config.pushContent来完成。需要的上下文内容在context对象中提供。
◆ recordHandler
话单自定义回调,如果需要修发送话单内容可以在此回调中修改message相关字段
◆ timeOutSeconds
- (NSTimeInterval) timeOutSeconds |
|
readwritenonatomicassign |
单位:秒,IM服务器邀请2分钟后无响应为超时,最大值不超过2分钟。
◆ tokenHandler
安全模式音视频房间token获取,nil表示非安全模式. Block中一定要调用complete
该类的文档由以下文件生成: