NERTCCallkit iOS API  V1.8.0
构造函数 | 类方法 | 属性 | 所有成员列表
NERtcCallKit类 参考
类 NERtcCallKit 继承关系图:

构造函数

(void) - setupAppKey:options:
 
(void) - setupAppKey:withRtcUid:options:
 
(void) - setupAppKey:options:withContext:
 
(void) - login:token:completion:
 
(void) - updateApnsToken:
 
(void) - updatePushKitToken:
 
(void) - logout:
 登出
 
(void) - call:type:completion:
 
(void) - call:type:attachment:completion:
 
(void) - call:type:attachment:globalExtra:completion:
 
(void) - call:type:attachment:globalExtra:withToken:channelName:completion:
 
(void) - groupCall:groupID:type:completion:
 
(void) - groupCall:groupID:type:attachment:completion:
 
(void) - groupInvite:groupID:completion:
 
(void) - groupInvite:groupID:attachment:completion:
 
(void) - cancel:
 
(void) - accept:
 
(void) - acceptWithToken:withCompletion:
 
(void) - reject:
 
(void) - rejectWithReason:withCompletion:
 
(void) - hangup:
 
(void) - leave:
 
(void) - setupLocalView:
 
(void) - setupRemoteView:forUser:
 
(int) - enableLocalVideo:
 
(int) - muteLocalVideo:
 
(int) - switchCamera
 
(int) - muteLocalAudio:
 
(void) - switchCallType:withState:completion:
 
(void) - setLoudSpeakerMode:error:
 
(void) - setAudioMute:forUser:error:
 
(void) - memberOfUid:completion:
 
(void) - memberOfAccid:completion:
 
(void) - addDelegate:
 
(void) - removeDelegate:
 
(void) - enableSwitchCallTypeConfirmVideo:audio:
 

类方法

(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统计回调
 

函数文档

◆ accept:

- (void) accept: (nullable void(^)(NSError *_Nullable error))  completion

接受呼叫

参数
completion回调

◆ acceptWithToken:withCompletion:

- (void) acceptWithToken: (nullable NSString *)  token
withCompletion: (nullable void(^)(NSError *_Nullable error))  completion 

接受呼叫

参数
token用户token,如果用户直接传入,不需要实现 tokenHandler block回调
completion回调

◆ addDelegate:

- (void) addDelegate: (id< NERtcCallKitDelegate >)  delegate

添加代理 接受回调

参数
delegate代理对象

◆ 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

取消呼叫

参数
completion回调

◆ enableLocalVideo:

- (int) enableLocalVideo: (BOOL)  enable

启动或关闭摄像头

参数
enableYES:启动,NO:关闭
返回
操作返回值,成功则返回 0

◆ enableSwitchCallTypeConfirmVideo:audio:

- (void) enableSwitchCallTypeConfirmVideo: (BOOL)  video
audio: (BOOL)  audio 

音视频切换是否需要确认配置

参数
video切换到视频是否需要确认
audio切换到音频是否需要确认

◆ groupCall:groupID:type:attachment:completion:

- (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回调

◆ groupCall:groupID:type:completion:

- (void) groupCall: (NSArray< NSString * > *)  userIDs
groupID: (nullable NSString *)  groupID
type: (NERtcCallType)  type
completion: (nullable void(^)(NSError *_Nullable error))  completion 

多人呼叫

参数
userIDs呼叫的用户ID数组 (不包含自己)
type通话类型
completion回调

◆ groupInvite:groupID:attachment: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回调

◆ groupInvite:groupID:completion:

- (void) groupInvite: (NSArray< NSString * > *)  userIDs
groupID: (nullable NSString *)  groupID
completion: (nullable void(^)(NSError *_Nullable error))  completion 

呼叫过程中邀请用户加入(仅限群呼)

参数
userIDs呼叫的用户ID数组 (不包含自己)
completion回调

◆ hangup:

- (void) hangup: (nullable void(^)(NSError *_Nullable error))  completion

挂断

参数
completion回调

◆ leave:

- (void) leave: (nullable void(^)(NSError *_Nullable error))  completion

离开,不挂断

参数
completion回调

◆ login:token:completion:

- (void) login: (NSString *)  userID
token: (NSString *)  token
completion: (nullable void(^)(NSError *_Nullable error))  completion 

登录IM接口,所有功能需要先进行登录后才能使用

参数
userIDIM用户accid
tokenIM用户token
completion回调

◆ memberOfAccid:completion:

- (void) memberOfAccid: (NSString *)  accid
completion: (nullable void(^)(NIMSignalingMemberInfo *_Nullable info))  completion 

根据uid 获取 accid

参数
accidIM 用户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

麦克风静音

参数
muteYES:静音 NO:开启
返回
操作返回值,成功则返回 0

◆ muteLocalVideo:

- (int) muteLocalVideo: (BOOL)  muted

开启或关闭视频采集

参数
mutedYES:关闭,NO:开启
返回
操作返回值,成功则返回 0

◆ reject:

- (void) reject: (nullable void(^)(NSError *_Nullable error))  completion

拒绝呼叫

参数
completion回调

◆ rejectWithReason:withCompletion:

- (void) rejectWithReason: (NSInteger)  reason
withCompletion: (nullable void(^)(NSError *_Nullable error))  completion 

拒绝呼叫

参数
completion回调
reason挂断原因

◆ removeDelegate:

- (void) removeDelegate: (id< NERtcCallKitDelegate >)  delegate

移除代理

参数
delegate代理对象

◆ 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 

是否使用扬声器模式

参数
speakerYES:扬声器 NO:听筒
error错误,成功为nil

◆ setupAppKey:options:

- (void) setupAppKey: (NSString *)  appKey
options: (nullable NERtcCallOptions *)  options 

初始化,所有功能需要先初始化

参数
appKey云信后台注册的appKey

◆ setupAppKey:options:withContext:

- (void) setupAppKey: (NSString *)  appKey
options: (nullable NERtcCallOptions *)  options
withContext: (nonnull NERtcEngineContext *)  context 

初始化,所有功能需要先初始化,支持私有化

参数
appKey云信后台注册的appKey
optionsIM 推送配置,Rtc是否初始化
contextRtc初始化配置,私有化参数配置

◆ 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: (NSString *)  userID 

设置其他用户画面

参数
remoteView渲染其他画面的View
userID其他用户ID @discussion remoteView上不建议有任何subview

◆ 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

- (int) switchCamera

切换摄像头

返回
操作返回值,成功则返回 0

◆ updateApnsToken:

- (void) updateApnsToken: (NSData *)  deviceToken

更新APNS deviceToken

参数
deviceToken注册获得的deviceToken

◆ updatePushKitToken:

- (void) updatePushKitToken: (NSData *)  pushkitToken

更新 PushKit Token

参数
pushkitToken目前仅支持 PKPushTypeVoIP

属性说明

◆ engineDelegate

- (id<NERtcEngineDelegateEx>) engineDelegate
readwritenonatomicweak

NERtcEngine 的回调接口,由用户提供


该类的文档由以下文件生成: