JLChen
2021-05-13 7f62f2d3bf626ac55d2d2de05ca1d71eaaabef39
iOS/Xamarin/LCSDKOnXamarin/LCSDKOnXamarin/LCOnIntercomViewController.m
@@ -9,7 +9,9 @@
#import <AVFoundation/AVFoundation.h>
#import <Photos/Photos.h>
#import <AudioToolbox/AudioToolbox.h>
#import "LCKit.h"
#import "LCUtlis.h"
#import "LCApiKit.h"
#import <LCOpenSDKDynamic/LCOpenSDKDynamic.h>
@interface LCOnIntercomViewController ()<LCOpenSDK_EventListener, LCOpenSDK_TalkerListener>
@@ -90,8 +92,11 @@
    //开始反呼
    [self StartReverseCall];
    [self ShowCalltimeBtn:callingStr];
    //暂时不支持开锁功能
    [self setUnlock:NO];
//    //暂时不支持开锁功能
//    [self setUnlock:NO];
    //注册开锁成功监听
    [self addOpenSuccessAction];
    // Do any additional setup after loading the view.
}
@@ -282,11 +287,10 @@
-(void)unlockAction{
    [_unlockImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_unlock_unselect"] forState:UIControlStateNormal];
    //    //开锁
    //    if(_es){
    //        [_es openTheDoorWithRoomid:_mESRoomID];
    //    }
    //开锁
    if(self.mLCCallDelegate != NULL){
       [self.mLCCallDelegate onUnlockAction];
    }
}
#pragma 挂断和开锁
@@ -305,13 +309,13 @@
//挂断按钮事件
-(void)hangUpAction{
    //1.回调事件
    if(self.mESCallDelegate != NULL){
    if(self.mLCCallDelegate != NULL){
        if(isAnswer){
            //如果之前已经接听了,回调是挂断
            [self.mESCallDelegate onHangUpAction:_callTimeout];
            [self.mLCCallDelegate onHangUpAction:_callTimeout];
        }else{
            //如果之前没接听了,回调是拒接
            [self.mESCallDelegate onRejectCallAction];
            [self.mLCCallDelegate onRejectCallAction];
        }
    }
    //2.页面关闭
@@ -364,8 +368,8 @@
    [self startCountdown];
    isAnswer = YES;
    
    if(self.mESCallDelegate != NULL){
        [self.mESCallDelegate onAnswerAction];
    if(self.mLCCallDelegate != NULL){
        [self.mLCCallDelegate onAnswerAction];
    }
    
}
@@ -503,10 +507,7 @@
    _openDoorTimeout = 0;
    [self startOpenDoorCountdown];
    [self showUIAlertView:unlockSuccessfullyStr];
    // 开锁成功回调
    if(self.mESCallDelegate != NULL){
        [self.mESCallDelegate onUnlockAction];
    }
}
-(void)setUnlock:(BOOL)ISEnable{
@@ -1025,8 +1026,8 @@
    if (!error) {
        message = saveToTheAlbumsStr;
        // 截图成功回调
        if(self.mESCallDelegate != NULL){
            [self.mESCallDelegate onScreenshotSuccessfulAction:image];
        if(self.mLCCallDelegate != NULL){
            [self.mLCCallDelegate onScreenshotSuccessfulAction:image];
        }
    }
    else
@@ -1119,8 +1120,25 @@
//}
///
- (void)addOpenSuccessAction {
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:LCCallDelegateOpenDoorSuccess
                                                  object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(setOpenDoorSuccess)
                                                 name:LCCallDelegateOpenDoorSuccess
                                               object:nil];
}
- (void)removeOpenSuccessAction {
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:LCCallDelegateOpenDoorSuccess
                                                  object:nil];
}
@end