5#import <Foundation/Foundation.h>
27NS_ASSUME_NONNULL_BEGIN
31@protocol NERtcCallKitDelegate <NSObject>
41- (void)onInvited:(NSString *)invitor
42 userIDs:(NSArray<NSString *> *)userIDs
43 isFromGroup:(BOOL)isFromGroup
44 groupID:(nullable NSString *)groupID
45 type:(NERtcCallType)type
46 NERtcCallKitDeprecate("use -onInvited:userIDs:isFromGroup:groupID:type:attachment: instead");
54- (void)onInvited:(NSString *)invitor
55 userIDs:(NSArray<NSString *> *)userIDs
56 isFromGroup:(BOOL)isFromGroup
57 groupID:(nullable NSString *)groupID
58 type:(NERtcCallType)type
59 attachment:(nullable NSString *)attachment;
63- (void)onUserEnter:(NSString *)userID;
67- (void)onUserReject:(NSString *)userID;
71- (void)onUserCancel:(NSString *)userID;
75- (void)onUserLeave:(NSString *)userID;
79- (void)onUserDisconnect:(NSString *)userID;
83- (void)onUserAccept:(NSString *)userID;
87- (void)onUserBusy:(NSString *)userID;
92- (void)onCallTypeChange:(NERtcCallType)callType withState:(
NERtcSwitchState)state;
96- (void)onCallTypeChange:(NERtcCallType)callType
97 NERtcCallKitDeprecate("use -onCallTypeChange:withState: instead");
103- (void)onCallingTimeOut;
107- (void)onDisconnect:(NSError *)reason;
110- (void)onError:(NSError *)error;
115- (void)onCameraAvailable:(BOOL)available userID:(NSString *)userID;
120- (void)onAudioAvailable:(BOOL)available userID:(NSString *)userID;
125- (void)onVideoMuted:(BOOL)muted userID:(NSString *)userID;
130- (void)onAudioMuted:(BOOL)muted userID:(NSString *)userID;
140- (void)onFirstVideoFrameDecoded:(NSString *)userID width:(uint32_t)width height:(uint32_t)height;
144- (void)onUserNetworkQuality:(NSDictionary<NSString *, NERtcNetworkQualityStats *> *)stats;
147- (void)onOtherClientAccept;
150- (void)onOtherClientReject;
153- (void)onNERtcEngineUser:(uint64_t)userID videoMuted:(BOOL)muted;
155- (void)onNERtcEngineUserVideoDidStartWithUserID:(uint64_t)userID
156 videoProfile:(NERtcVideoProfileType)profile;
183@property(nonatomic, weak) id<NERtcEngineMediaStatsObserver>
observer;
190- (void)setupAppKey:(NSString *)appKey options:(nullable
NERtcCallOptions *)options;
197- (void)setupAppKey:(NSString *)appKey
198 withRtcUid:(uint64_t)rtcUid
205- (void)setupAppKey:(NSString *)appKey
207 withContext:(nonnull NERtcEngineContext *)context;
213- (void)login:(NSString *)userID
214 token:(NSString *)token
215 completion:(nullable
void (^)(NSError *_Nullable error))completion;
219- (void)updateApnsToken:(NSData *)deviceToken;
223- (void)updatePushKitToken:(NSData *)pushkitToken;
226- (void)logout:(nullable
void (^)(NSError *_Nullable error))completion;
232- (void)call:(NSString *)userID
233 type:(NERtcCallType)type
234 completion:(nullable
void (^)(NSError *_Nullable error))completion;
241- (void)call:(NSString *)userID
242 type:(NERtcCallType)type
243 attachment:(nullable NSString *)attachment
244 completion:(nullable
void (^)(NSError *_Nullable error))completion;
252- (void)call:(NSString *)userID
253 type:(NERtcCallType)type
254 attachment:(nullable NSString *)attachment
255 globalExtra:(nullable NSString *)extra
256 completion:(nullable
void (^)(NSError *_Nullable error))completion;
266- (void)call:(NSString *)userID
267 type:(NERtcCallType)type
268 attachment:(nullable NSString *)attachment
269 globalExtra:(nullable NSString *)extra
270 withToken:(nullable NSString *)token
271 channelName:(nullable NSString *)channelName
272 completion:(nullable
void (^)(NSError *_Nullable error))completion;
276- (void)cancel:(nullable
void (^)(NSError *_Nullable error))completion;
280- (void)accept:(nullable
void (^)(NSError *_Nullable error))completion;
285- (void)acceptWithToken:(nullable NSString *)token
286 withCompletion:(nullable
void (^)(NSError *_Nullable error))completion;
290- (void)reject:(nullable
void (^)(NSError *_Nullable error))completion;
295- (void)rejectWithReason:(NSInteger)reason
296 withCompletion:(nullable
void (^)(NSError *_Nullable error))completion;
300- (void)hangup:(nullable
void (^)(NSError *_Nullable error))completion;
305- (void)setupLocalView:(nullable UIView *)localView;
311- (void)setupRemoteView:(nullable UIView *)remoteView forUser:(nullable NSString *)userID;
316- (int)enableLocalVideo:(BOOL)enable;
321- (int)muteLocalVideo:(BOOL)muted;
330- (int)muteLocalAudio:(BOOL)mute;
338- (void)switchCallType:(NERtcCallType)type
340 completion:(nullable
void (^)(NSError *_Nullable error))completion;
345- (void)setLoudSpeakerMode:(BOOL)speaker error:(NSError *_Nonnull *_Nonnull)error;
352- (void)setAudioMute:(BOOL)mute forUser:(NSString *)userID error:(NSError *_Nonnull *_Nonnull)error;
357- (void)memberOfUid:(uint64_t)uid
358 completion:(nullable
void (^)(NIMSignalingMemberInfo *_Nullable info))completion;
363- (void)memberOfAccid:(NSString *)accid
364 completion:(nullable
void (^)(NIMSignalingMemberInfo *_Nullable info))completion;
368- (void)addDelegate:(
id<NERtcCallKitDelegate>)delegate;
372- (void)removeDelegate:(
id<NERtcCallKitDelegate>)delegate;
377- (void)enableSwitchCallTypeConfirmVideo:(BOOL)video audio:(BOOL)audio;
void(^ NERtcCallKitTokenHandler)(uint64_t uid, NSString *channelName, void(^complete)(NSString *token, NSError *error))
定义 NECallEngineConsts.h:133
NERtcCallStatus
通话状态
定义 NECallEngineConsts.h:41
NERtcSwitchState
通话行为
定义 NECallEngineConsts.h:108
void(^ NERtcCallKitPushConfigHandler)(NERtcCallKitPushConfig *config, NERtcCallKitContext *context)
定义 NECallEngineConsts.h:136
NS_ASSUME_NONNULL_BEGIN typedef void(^ NERtcCallKitRecordMessageHander)(V2NIMMessage *message)
Project version number for NERtcCallKit.
NERtcCallKitRecordMessageHander recordHandler
话单自定义回调,如果需要修发送话单内容可以在此回调中修改message相关字段
定义 NERtcCallKit.h:177
NSTimeInterval timeOutSeconds
单位:秒,IM服务器邀请2分钟后无响应为超时,最大值不超过2分钟。
定义 NERtcCallKit.h:168
id< NERtcEngineDelegateEx > engineDelegate
NERtcEngine 的回调接口,由用户提供
定义 NERtcCallKit.h:180
instancetype sharedInstance()
单例
定义 NERtcCallKit.m:57
NSString * versionCode()
版本号
定义 NERtcCallKit.m:349
id< NERtcEngineMediaStatsObserver > observer
中转NERtcEngine统计回调
定义 NERtcCallKit.h:183
NERtcCallStatus callStatus
通话状态
定义 NERtcCallKit.h:165
NERtcCallKitPushConfigHandler pushConfigHandler
推送配置定制化,修改config.pushTitle,config.pushContent来完成。需要的上下文内容在context对象中提供。
定义 NERtcCallKit.h:174
NERtcCallKitTokenHandler tokenHandler
安全模式音视频房间token获取,nil表示非安全模式. Block中一定要调用complete
定义 NERtcCallKit.h:171
定义 NERtcCallKitJoinChannelEvent.h:10