// // ViewController.m // LCOnDemo // // Created by é™ˆå˜‰ä¹ on 2021/4/26. // #import "ViewController.h" #import "LCOnIntercomViewController.h" #import "LCOnMonitorViewController.h" #import "LCUtlis.h" #import "LCCallDelegate.h" #import "LCApiKit.h" @interface ViewController ()<LCCallDelegate> @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } -(void)initLCSDK{ //åˆå§‹åŒ–LCOpenSDK_Api [[LCApiKit sharedInstance] initSDKOpenApi:@"St_0000070a12e995ed44628eeea75a19fc"]; [[LCApiKit sharedInstance] setCurrentDevicePlayToken:@"5a9cbb4ab2454454ba4995addf3760cc"]; [[LCApiKit sharedInstance] setCurrentDeviceId:@"6K056CFAAJ8FFA1"]; [[LCApiKit sharedInstance] setCurrentDeviceName:@"大åŽå¯è§†å¯¹è®²"]; [[LCApiKit sharedInstance] setCurrentPsk:@"6K056CFAAJ8FFA1"]; } ///监控 - (IBAction)monitoringAction:(id)sender { [self initLCSDK]; LCOnMonitorViewController *mVc = [[LCOnMonitorViewController alloc] init]; [self.navigationController.navigationBar setHidden: YES]; [self.navigationController pushViewController:mVc animated:YES]; } ///æ¥ç”µæŽ¥å¬ - (IBAction)callAction:(id)sender { [self initLCSDK]; LCOnIntercomViewController *mVc = [[LCOnIntercomViewController alloc] init]; mVc.mLCCallDelegate = self; [self.navigationController.navigationBar setHidden: YES]; [self.navigationController pushViewController:mVc animated:YES]; } - (void)onAnswerAction { } - (void)onHangUpAction:(int)callDuration { } - (void)onRejectCallAction { } - (void)onScreenshotSuccessfulAction:(nonnull UIImage *)image { } - (void)onUnlockAction { NSLog(@"onUnlockAction:准备开é”"); dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ NSLog(@"onUnlockActionï¼šé€šçŸ¥å¼€é”æˆåŠŸ"); [[NSNotificationCenter defaultCenter] postNotificationName:LCCallDelegateOpenDoorSuccess object:self]; }); } @end