From b469805b2d0c9b23ca020cf9356ff137205f856c Mon Sep 17 00:00:00 2001 From: 464027401@qq.com <464027401@qq.com> Date: 星期一, 27 九月 2021 10:22:10 +0800 Subject: [PATCH] 修复来点页面重复呼叫时alert位置不对问题 --- HDLLinPhoneSDK(OC)/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" index 1ea7374..2b91526 100644 --- "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" +++ "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m" @@ -35,6 +35,9 @@ @property (nonatomic,strong) dispatch_source_t openDoorTimer; @property (nonatomic, assign) int openDoorTimeout; @property (nonatomic, assign) int callTimeout; + +@property (nonatomic, assign) BOOL isHangUpByRemote;//鏄惁瀵规柟杩滅▼鎸傛柇 + @end @implementation HDLLinphoneIntercomVC{ @@ -90,11 +93,15 @@ } + - (void)linphoneCallUpdate:(NSNotification *)notif { int state = [[notif.userInfo objectForKey:@"state"] intValue]; - if ((state == LinphoneCallEnd || state == LinphoneCallError)) {//鎸傛柇浜� + if ((state == LinphoneCallEnd || state == LinphoneCallError)) {//鎸傛柇浜�(铏界劧鑷繁鎸傛柇涔熶細璧癓inphoneCallUpdate閫氱煡锛屼絾鑷繁鎸傛柇鐨勮瘽椤甸潰宸查攢姣侊紝涓嶄細瑙﹀彂璇ユ柟娉�) NSLog(@"鎸傛柇鎴栧嚭閿欎簡"); + [self stopPlaySystemSound]; + self.isHangUpByRemote=YES; [self showUIAlertViewWithBack:@"閫氳瘽缁撴潫"]; + } } @@ -331,6 +338,7 @@ } return _hangUpTextBtn; } + //鎺ュ惉 鍥炬爣鎸夐挳 - (UIButton *)answerImgBtn{ if (_answerImgBtn == nil) { @@ -653,7 +661,9 @@ [self stopPlaySystemSound]; //闃叉鐢ㄦ埛涓嶆寜鎸傛柇锛屾垨鑰呬笉绛夋敹鍒板鏂圭殑鎸傛柇锛岀偣鍑昏繑鍥炴寜閽�� //1.鏆傚仠SDK鐩稿叧鎾斁 - [self stopPlay]; + if (!self.isHangUpByRemote) { + [self stopPlay]; + } //2.Delegate閲婃斁 self.hdlLinphoneCallDelegate = nil; //3.瀹氭椂鍣ㄩ噴鏀� @@ -672,8 +682,8 @@ } -(void)dealloc{ - NSLog(@"==============dealloc 1"); - [[NSNotificationCenter defaultCenter] removeObserver:self]; + NSLog(@"==============dealloc 瀵硅薄閿�姣佷簡"); +// [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)willEnterForeground:(NSNotification*)notification{ NSLog(@"willEnterForeground"); -- Gitblit v1.8.0