差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
cs:300visitoraccess:iossdkapi [2019/05/20 04:14] liulj [发送扩展消息] |
cs:300visitoraccess:iossdkapi [2020/01/20 06:56] candywang [发送带访客属性的消息] |
||
---|---|---|---|
行 111: | 行 111: | ||
visitor.phone = @"13636362637"; | visitor.phone = @"13636362637"; | ||
visitor.companyName = @"环信"; | visitor.companyName = @"环信"; | ||
- | visitor.nickName = @"风口上的猪"; | + | visitor.nickName = @"风口上的猪"; //必填 |
visitor.email = @"abv@126.com"; | visitor.email = @"abv@126.com"; | ||
visitor.desc = @"环信客服云"; | visitor.desc = @"环信客服云"; | ||
行 444: | 行 444: | ||
===== 实时音视频 ===== | ===== 实时音视频 ===== | ||
- | ==== 实时通话相关 ==== | + | ==== 基本设置 ==== |
<code> | <code> | ||
行 454: | 行 454: | ||
options.previewView = <#(HCallLocalView*)#>; //本地预览View | options.previewView = <#(HCallLocalView*)#>; //本地预览View | ||
[[HDClient sharedClient].callManager setCallOptions:options]; | [[HDClient sharedClient].callManager setCallOptions:options]; | ||
- | //注册实时通话回调 | + | </code> |
+ | |||
+ | ==== 监听呼入通话 ==== | ||
+ | |||
+ | <code> | ||
+ | //注册实时通话回调 | ||
[[HDClient sharedClient].callManager addDelegate:<#(id<HDCallManagerDelegate>)#> delegateQueue:nil]; //queue默认为main | [[HDClient sharedClient].callManager addDelegate:<#(id<HDCallManagerDelegate>)#> delegateQueue:nil]; //queue默认为main | ||
//移除实时通话回调 | //移除实时通话回调 | ||
行 474: | 行 479: | ||
- (void)onNotice:(HMediaNoticeCode)code arg1:(NSString *)arg1 arg2:(NSString *)arg2 arg3:(id)arg3; | - (void)onNotice:(HMediaNoticeCode)code arg1:(NSString *)arg1 arg2:(NSString *)arg2 arg3:(id)arg3; | ||
- | //接受视频请求 | + | </code> |
+ | |||
+ | ==== 接听通话 ==== | ||
+ | <code> | ||
[[HDClient sharedClient].callManager acceptCallCompletion:^(id obj, HDError *error) { | [[HDClient sharedClient].callManager acceptCallCompletion:^(id obj, HDError *error) { | ||
if (error == nil) { //接受成功 | if (error == nil) { //接受成功 | ||
} | } | ||
}]; | }]; | ||
- | //拒绝视频请求 | + | </code> |
+ | |||
+ | ==== 拒绝接听 ==== | ||
+ | <code> | ||
[[HDClient sharedClient].callManager endCall]; | [[HDClient sharedClient].callManager endCall]; | ||
- | //挂断视频请求 | + | </code> |
+ | |||
+ | ==== 挂断通话 ==== | ||
+ | <code> | ||
[[HDClient sharedClient].callManager endCall]; | [[HDClient sharedClient].callManager endCall]; | ||
- | //切换镜头 | + | </code> |
- | [[HDClient sharedClient].callManager switchCameraPosition:YES]; //默认前置摄像头(YES) | + | |
+ | |||
+ | ==== 暂停和恢复语音或视频数据传输 ==== | ||
+ | |||
+ | <code> | ||
//关闭麦克风 | //关闭麦克风 | ||
[[HDClient sharedClient].callManager pauseVoice]; | [[HDClient sharedClient].callManager pauseVoice]; | ||
行 494: | 行 512: | ||
[[HDClient sharedClient].callManager resumeVideo]; | [[HDClient sharedClient].callManager resumeVideo]; | ||
- | //订阅成员视频 | + | </code> |
+ | |||
+ | ==== 切换摄像头 ==== | ||
+ | <code> | ||
+ | //切换镜头 | ||
+ | [[HDClient sharedClient].callManager switchCameraPosition:YES]; //默认前置摄像头(YES) | ||
+ | </code> | ||
+ | |||
+ | ==== 视频通话订阅对方的流和显示图像 ==== | ||
+ | |||
+ | <code> | ||
+ | // topView 用于显示的view | ||
[[HDClient sharedClient].callManager subscribeStreamId:streamId view:topView completion:^(id obj, HDError *error) { | [[HDClient sharedClient].callManager subscribeStreamId:streamId view:topView completion:^(id obj, HDError *error) { | ||
if (error == nil) { | if (error == nil) { | ||
行 500: | 行 529: | ||
} | } | ||
}]; | }]; | ||
- | //取消订阅 | + | </code> |
+ | |||
+ | ==== 取消订阅 ==== | ||
+ | <code> | ||
[[HDClient sharedClient].callManager unSubscribeStreamId:streamId completion:^(id obj, HDError *error) { | [[HDClient sharedClient].callManager unSubscribeStreamId:streamId completion:^(id obj, HDError *error) { | ||
if (error == nil) { | if (error == nil) { | ||
行 508: | 行 540: | ||
</code> | </code> | ||
+ | ==== 取消视频邀请 ==== | ||
+ | <code> | ||
+ | [[HDClient sharedClient].callManager asyncCancelVideoInviteWithImId:<#im服务号#> completion:^(HDError *error) { | ||
+ | | ||
+ | }]; | ||
+ | </code> | ||
===== 高级功能 ===== | ===== 高级功能 ===== | ||
==== 显示排队人数 ==== | ==== 显示排队人数 ==== | ||
- | 首先,初始化时,需要调用''option.visitorWaitCount = YES;''打开待接入访客排队人数功能。 然后实现HDChatManagerDelegate中的''visitorWaitCount''方法。 | + | 首先,初始化时,需要调用''option.visitorWaitCount = YES;''打开待接入访客排队人数功能。 完成以下设置,之后实现HDChatManagerDelegate中的''visitorWaitCount''方法。 |
- | + | 1、在sdk初始化时开始设置: | |
+ | <code> | ||
+ | HDOptions *option = [[HDOptions alloc] init]; | ||
+ | ... | ||
+ | option.visitorWaitCount = YES; | ||
+ | HDError *initError = [[HDClient sharedClient] initializeSDKWithOptions:option]; | ||
+ | </code> | ||
+ | 2、调用方法: | ||
+ | <code> | ||
+ | [[HDClient sharedClient].chatManager bindChatWithConversationId:<#会话id#>]; | ||
+ | </code> | ||
+ | |||
+ | 3、当调用以上方法后,排队人数会开启查询模式,每隔3秒左右会回调HDChatManagerDelegate#visitorWaitCount:方法上报排队人数。 | ||
<code> | <code> | ||
-(void)visitorWaitCount:(int)count; | -(void)visitorWaitCount:(int)count; |