From 8227d1cefb20e357250a4a7fe8da32141b6cfc1e Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期二, 24 八月 2021 17:29:10 +0800 Subject: [PATCH] 提交原生sdk工程 --- HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m index 136009d..a2556a8 100644 --- a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m +++ b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m @@ -77,8 +77,22 @@ self.titleUILabel.text=self.titleName; } // self.titleUILabel.text=self.titleName; + + [NSNotificationCenter.defaultCenter addObserver:self + selector:@selector(registrationUpdate:) + name:@"LinphoneRegistrationUpdate" + object:nil]; + } +- (void)registrationUpdate:(NSNotification *)notif { + int state = [[notif.userInfo objectForKey:@"state"] intValue]; + if(state==11){//鎸傛柇浜� + NSLog(@"鎸傛柇鎴栧嚭閿欎簡"); + [self showUIAlertViewWithBack:@"閫氳瘽缁撴潫"]; + + } +} -(void)initLlanguage{ NSString *languageName = [[[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"] objectAtIndex:0]; @@ -629,6 +643,7 @@ } -(void)viewWillDisappear:(BOOL)animated{ + NSLog(@"viewWillDisappear"); [super viewWillDisappear:animated]; [self stopPlaySystemSound]; //闃叉鐢ㄦ埛涓嶆寜鎸傛柇锛屾垨鑰呬笉绛夋敹鍒板鏂圭殑鎸傛柇锛岀偣鍑昏繑鍥炴寜閽�� @@ -646,6 +661,8 @@ _countdownTimer = nil; // OK } + + [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -711,7 +728,7 @@ #pragma 闇囧姩瀹炵幇璨屼技鍜孲DK鍐茬獊 涓嶈兘瀹炵幇闇囧姩 //寮�濮嬫挱鏀剧殑鏃跺�欒皟鐢� -(void)startPlaySystemSound{ - return; +// return; // //闇囧姩鐨勬彁绀烘枃浠跺悕鏀惧埌璧勬簮鐩綍涓� // NSString *path = [[NSBundle mainBundle] pathForResource:@"ring" ofType:@"wav"]; // AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &sound); @@ -724,13 +741,13 @@ //鎵嬪姩鍋滄鎾斁鐨勬椂鍊欒皟鐢� - (void)stopPlaySystemSound{ - return; +// return; NSLog(@"stop PlaySystemSound"); - stopRingAndVibration(); + HDLLPStopRingAndVibration(); } //鍋滄鍝嶉搩鍜岄渿鍔紝绉婚櫎鍥炶皟骞跺鐞嗘帀閾冨0鍜岄渿鍔� -void stopRingAndVibration() { +void HDLLPStopRingAndVibration() { AudioServicesRemoveSystemSoundCompletion(kSystemSoundID_Vibrate); // AudioServicesRemoveSystemSoundCompletion(sound); AudioServicesDisposeSystemSoundID(kSystemSoundID_Vibrate); -- Gitblit v1.8.0