From 485a9553e08984a945d692483b1aea15a02ef5ab Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期一, 13 三月 2023 11:09:17 +0800
Subject: [PATCH] 1.更新sdk到5.1.1 2.新增临时密码列表界面 3.新增跳转添加设备页接口 4.新增添加门锁设备逻辑

---
 EZSDK/EZSDK/EZSDK.m |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/EZSDK/EZSDK/EZSDK.m b/EZSDK/EZSDK/EZSDK.m
index f8d0607..81b7859 100644
--- a/EZSDK/EZSDK/EZSDK.m
+++ b/EZSDK/EZSDK/EZSDK.m
@@ -19,7 +19,7 @@
 #import "EZDeviceTableViewController.h"
 #import "EZHCNetDeviceSDK.h"
 #import "EZMessagePhotoViewController.h"
-
+#import "HDLEZVisitorRecordViewController.h"
 
 
 
@@ -45,8 +45,8 @@
  */
 - (BOOL)initLibWithAppKey:(NSString *)appKey globalAppKey:(NSString *)globalAppKey
 {
-  
     if (!isHavelibInit) {
+        [EZOPENSDK setDebugLogEnable:YES];
         //        isHavelibInit=YES;
         //        NSLog(@"绗竴娆″垵濮嬪寲钀ょ煶搴�");
         if (!LanguageIsChinese) {
@@ -55,13 +55,15 @@
             NSLog(@"娴峰鐗坘ey--%@",globalAppKey);
         }else{
             isHavelibInit = [EZOpenSDK initLibWithAppKey:appKey];
+            [[GlobalKit shareKit] setHdlAppKey:appKey];
             NSLog(@"鍥藉唴鐗坘ey--%@", appKey);
         }
-        
         [EZHCNetDeviceSDK initSDK];
         [EZOPENSDK enableP2P:YES];
-        [EZOPENSDK setDebugLogEnable:YES];
+//        [EZOPENSDK setDebugLogEnable:YES];
         NSLog(@"EZOpenSDK Version = %@", [EZOPENSDK getVersion]);
+//        NSLog(@"EZOpenSDK treamToken= %@", );
+
     }
     return isHavelibInit;
 }
@@ -135,17 +137,35 @@
  */
 -(void)addEzvizMonitor
 {
+//    //    NSLog(@"娣诲姞鎽勫儚澶�");
+//    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
+//        UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"AddDevice" bundle:nil];
+//        EZAddByQRCodeViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"AddByQRCode"];
+//        [[self getCurrentVC] setNavigationBarHidden:NO];
+//        [[self getCurrentVC] pushViewController:rootViewController animated:YES];
+//    } else {
+//        //        [UIView dd_showMessage:@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�"];
+//        NSLog(@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�");
+//    }
+    [self addEzvizMonitorWithDeviceType:HDLEZDeviceType_Default];
+}
+
+/**
+ 璺宠浆娣诲姞娣诲姞璁惧
+ @param deviceType 璁惧绫诲瀷
+ */
+- (void)addEzvizMonitorWithDeviceType:(HDLEZDeviceType)deviceType{
     //    NSLog(@"娣诲姞鎽勫儚澶�");
     if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
         UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"AddDevice" bundle:nil];
         EZAddByQRCodeViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"AddByQRCode"];
+        rootViewController.deviceType=deviceType;
         [[self getCurrentVC] setNavigationBarHidden:NO];
         [[self getCurrentVC] pushViewController:rootViewController animated:YES];
     } else {
         //        [UIView dd_showMessage:@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�"];
         NSLog(@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�");
     }
-    
 }
 
 /**
@@ -205,6 +225,16 @@
     [[self getCurrentVC] pushViewController:playBackVC animated:YES];
 }
 
+/**涓存椂瀵嗙爜椤�
+ @param deviceId 璁惧id
+ */
+- (void)toTemPassView:(NSString*)deviceId{
+    HDLEZVisitorRecordViewController *vc=[[HDLEZVisitorRecordViewController alloc] init];
+    vc.deviceId=deviceId;
+    [[self getCurrentVC] setNavigationBarHidden:YES];
+    [[self getCurrentVC] pushViewController:vc animated:YES];
+}
+
 ////
 //-(void)goToEZMessagePhotoVC:(EZAlarmInfo*)alarmInfo{
 //    UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"EZMain" bundle:nil];

--
Gitblit v1.8.0