萤石云 iOSSDK,移植跨平台相关工程
Davin
2024-12-18 a67450d72c47f400e56525125318ff1d6ca0a2e8
feature 萤石活动检测&画面翻转调整
2个文件已添加
6个文件已修改
182 ■■■■■ 已修改文件
EZDemo/HDLEZDemo/HDLEZDemo/AppDelegate.m 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a 补丁 | 查看 | 原始文档 | blame | 历史
EZSDK.IOS/EZSDK.IOS/Library/libEZSDK.a 补丁 | 查看 | 原始文档 | blame | 历史
EZSDK/EZSDK.xcodeproj/project.pbxproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDetectionTypeViewController.m 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EZSDK/EZSDK/EZ/TempPassword/Views/HDLESDetectionTypeHeaderView.h 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EZSDK/EZSDK/EZ/TempPassword/Views/HDLESDetectionTypeHeaderView.m 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EZSDK/EZSDK/EZ/UIViewControllers/EZSettingViewController.m 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EZDemo/HDLEZDemo/HDLEZDemo/AppDelegate.m
@@ -25,10 +25,10 @@
    // Override point for customization after application launch.
    [[EZSDK sharedInstance] initLibWithAppKey:@"1aa98a90489b4838b966b57018b4b04b" globalAppKey:@"1aa98a90489b4838b966b57018b4b04b"];
//    [[EZSDK sharedInstance] initLibWithAppKey:@"941b1b72b6294998acfd36c14931b675" globalAppKey:@"941b1b72b6294998acfd36c14931b675"];
    [[EZSDK sharedInstance] setHDlAccessToken:@"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiIxODZlNWIxOTlhMzI0NzdhOTg0MTc1NWFiZDgwNjhiYSIsImNvbXBhbnlJZCI6IjAiLCJyb2xlIjoiIiwiaGVhZGVyUHJlZml4IjoiQmVhcmVyICIsInRlbmFudElkIjoiMjAiLCJ1c2VyVHlwZSI6IlVTRVJfQyIsInRva2VuVHlwZSI6ImFjY2Vzc190b2tlbiIsInVzZXJOYW1lIjoi54eV5ZCbIiwidXNlckRhdGFSaWdodCI6IjEiLCJvcGVuQXBwbGljYXRpb25JZCI6IjAiLCJ1c2VySWQiOiIxNjU2OTE3NDUxMjgxNTM0OTc3IiwiZXhwIjoxNzMwODkxMzczLCJuYmYiOjE3MzA4ODQxNzN9.TYaCAGVQ1c427INqyRLTM9hEpBpIdxm6mj6P2e4DlrvQ-jNjfP7sEphx3Bj7ZH7_lUIenwnCrO_crxIwgvzW3xjCv0D3qzeCbzbf5ynT0sYHIT2hWTJl4tdUYAK-BsEhf7Sfj9se0LzSmDEs2Sbmrm6BoUsViIbS8uVXOpZnPyU" refreshToken:@"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiIzYTQ2MDgxZDI4YWY0MjlmYmUzNTAxOWFlZTgwYmM5MCIsImNvbXBhbnlJZCI6IjAiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidGVuYW50SWQiOiIyMCIsInRva2VuVHlwZSI6InJlZnJlc2hfdG9rZW4iLCJvcGVuQXBwbGljYXRpb25JZCI6IjAiLCJ1c2VySWQiOiIxNjU2OTE3NDUxMjgxNTM0OTc3IiwiZXhwIjoxNzMxNDg4OTczLCJuYmYiOjE3MzA4ODQxNzN9.RDohTRVczdpxb4Pj9kvbEwHd2AUbYK0jps2kQk-WiVUE1HePoq-HjoYdYTwOw9CLvMuIUdDTru4AwQNtYgT9gF5jJEb7ePXrA8tStNvTyxu5FHMxaPGXY74UGg2H29_N4PEctBjb5A7z4NwJ36RajXsNyJweFLpZxX6QKXtrsbY"];
    [[EZSDK sharedInstance] setRequestHttpsHostAndPlatform:@"https://test-gz.hdlcontrol.com" platform:1 homeId:@"1719997413437546497"];
    [[EZSDK sharedInstance]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JlGHK8_AuJDeK_ES_Mtb0mFjqh4jl63rKtnAjMy9HX45g3xv0bx9FwLOHk4F5kVT1LmU3Wd2TcZEYl-DzLzdAHz7N9FRmoO9kCwTmXmohf7lWnR1-P7IHFVKqzAzvzVaDtUPUKngjxrTnDOvyRw"];
    [[EZSDK sharedInstance] setRequestHttpsHostAndPlatform:@"https://test-gz.hdlcontrol.com" platform:1 homeId:@"1641265620778082306"];
//    [[EZSDK sharedInstance] setRequestHttpsHostAndPlatform:@"https://nearest.hdlcontrol.com" platform:1 homeId:@"1546324800135176193"];
    [[EZSDK sharedInstance] setEZAccessToken:@"ra.cej51msz2lc9bd85dcjjh6lo3a1nvhd7-64dvf8rolg-1brlg88-nrsym3uwr"];
    [[EZSDK sharedInstance] setEZAccessToken:@"at.3q2ijwy72ne0d6nq0qwwxie5bvn4q3mh-83a3uo2h6v-010ytzk-9tezv7rzn"];
//    [[EZSDK sharedInstance] setEZAccessToken:@"ra.3hkirwcadrpfmaa89wep99io3wto4yds-7zptb10d20-1wxg4f3-ygiojudee"];
    
@@ -37,6 +37,9 @@
    _locationmanager.delegate = self;
    [_locationmanager requestWhenInUseAuthorization];
    [_locationmanager startUpdatingLocation];
    NSLog(@"#######-EZhdlAccessToken:%@", [[NSUserDefaults standardUserDefaults] objectForKey:@"EZhdlAccessToken"]);
    NSLog(@"#######-EZhdlRefreshToken:%@", [[NSUserDefaults standardUserDefaults] objectForKey:@"EZhdlRefreshToken"]);
    return YES;
}
EZDemo/HDLEZDemo/HDLEZDemo/libEZSDK.a
Binary files differ
EZSDK.IOS/EZSDK.IOS/Library/libEZSDK.a
Binary files differ
EZSDK/EZSDK.xcodeproj/project.pbxproj
@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
        830957C32A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 830957C22A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m */; };
        8318A0DA2A8A591D0012B894 /* FCFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8318A0D92A8A591D0012B894 /* FCFileManager.m */; };
        83336F022D1199E2000FE662 /* HDLESDetectionTypeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83336F012D1199E2000FE662 /* HDLESDetectionTypeHeaderView.m */; };
        8357F1DE2A42DEC000936D2E /* HDLEZVideoDoorToolView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8357F1DD2A42DEC000936D2E /* HDLEZVideoDoorToolView.m */; };
        83879A852A7DE42900E10A81 /* HDLEZDetectionTypeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83879A842A7DE42900E10A81 /* HDLEZDetectionTypeViewController.m */; };
        83879A882A7DE49900E10A81 /* HDLEZDetectionTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83879A872A7DE49900E10A81 /* HDLEZDetectionTypeView.m */; };
@@ -198,6 +199,8 @@
        830957C22A3AE3E1002B68AA /* HDLEZVideoDoorMsgCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HDLEZVideoDoorMsgCell.m; sourceTree = "<group>"; };
        8318A0D82A8A591D0012B894 /* FCFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FCFileManager.h; sourceTree = "<group>"; };
        8318A0D92A8A591D0012B894 /* FCFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FCFileManager.m; sourceTree = "<group>"; };
        83336F002D1199E2000FE662 /* HDLESDetectionTypeHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HDLESDetectionTypeHeaderView.h; sourceTree = "<group>"; };
        83336F012D1199E2000FE662 /* HDLESDetectionTypeHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HDLESDetectionTypeHeaderView.m; sourceTree = "<group>"; };
        8357F1DC2A42DEC000936D2E /* HDLEZVideoDoorToolView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HDLEZVideoDoorToolView.h; sourceTree = "<group>"; };
        8357F1DD2A42DEC000936D2E /* HDLEZVideoDoorToolView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HDLEZVideoDoorToolView.m; sourceTree = "<group>"; };
        83879A832A7DE42900E10A81 /* HDLEZDetectionTypeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HDLEZDetectionTypeViewController.h; sourceTree = "<group>"; };
@@ -710,6 +713,8 @@
                83D69FF92A47D32A00871258 /* HDLEZVideoQualityBoxView.m */,
                83879A862A7DE49900E10A81 /* HDLEZDetectionTypeView.h */,
                83879A872A7DE49900E10A81 /* HDLEZDetectionTypeView.m */,
                83336F002D1199E2000FE662 /* HDLESDetectionTypeHeaderView.h */,
                83336F012D1199E2000FE662 /* HDLESDetectionTypeHeaderView.m */,
                83879A892A7DE7FC00E10A81 /* HDLEZDetectionTypeCell.h */,
                83879A8A2A7DE7FC00E10A81 /* HDLEZDetectionTypeCell.m */,
                83DC3D932CDB5AEB00F9DDF7 /* HDLEZMirrorFlipView.h */,
@@ -1507,6 +1512,7 @@
                B9BC99F825C0FFBD00C024FE /* EZCustomTableView.m in Sources */,
                B9BC9A2625C0FFBD00C024FE /* EZEditViewController.m in Sources */,
                AEC306D529B9F2DB000B3861 /* HDLEZVisitorRecordCell.m in Sources */,
                83336F022D1199E2000FE662 /* HDLESDetectionTypeHeaderView.m in Sources */,
                AEDBFBA529C3072D005F6512 /* HDLEZDeviceMsgCell.m in Sources */,
                B9BC9A2525C0FFBD00C024FE /* EZOnlineCameraCell.m in Sources */,
                B9BC999B25C0FFBD00C024FE /* UITableView+FDTemplateLayoutCell.m in Sources */,
EZSDK/EZSDK/EZ/TempPassword/Controllers/HDLEZDetectionTypeViewController.m
@@ -6,10 +6,13 @@
//
#import "HDLEZDetectionTypeViewController.h"
#import "HDLESDetectionTypeHeaderView.h"
#import "HDLEZDetectionTypeView.h"
#import "MJRefreshNormalHeader.h"
@interface HDLEZDetectionTypeViewController ()
@property (nonatomic, strong) HDLESDetectionTypeHeaderView *detectionTypeHeaderView;
@property (nonatomic, strong) HDLEZDetectionTypeView *detectionTypeView;
@@ -43,11 +46,18 @@
    self.view.backgroundColor = HDLEZHEXCOLOR(0xF2F3F7, 1.);
    
    self.selectedCode = @"";
    [self.view addSubview:self.detectionTypeHeaderView];
    [self.view addSubview:self.detectionTypeView];
    [self.view addSubview:self.sureButton];
    
    [self.detectionTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
    [self.detectionTypeHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(HDLEZ_APP_TOP_BAR_HEIGHT);
        make.left.right.equalTo(self.view);
        make.height.mas_equalTo(60);
    }];
    [self.detectionTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(HDLEZ_APP_TOP_BAR_HEIGHT + 70);
        make.left.right.equalTo(self.view);
    }];
    
@@ -89,6 +99,32 @@
//    self.detectionTypeView.detectionTypeList = mArray;
    
    __weak __typeof(self)weakSelf = self;
    BOOL isDefence = (self.deviceInfo.defence != 0);
    [self updateDetectionView:isDefence];
    [self.detectionTypeHeaderView configSelected:isDefence switchResult:^(BOOL isSelected) {
        __weak MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        hud.labelText = NSLocalizedString(@"setting_switching", @"正在切换,请稍候...");
        /**
         *  注意;该demo只处理了IPC设备的布撤防,所有只有YES/NO,关于A系列设备请判断设备后修改枚举值再处理
         */
        [EZOPENSDK setDefence:isSelected
                 deviceSerial:weakSelf.deviceInfo.deviceSerial
                   completion:^(NSError *error) {
            [hud hide:YES];
            if (error) {
                [weakSelf.view makeToast:NSLocalizedString(@"setting_opration_fail", @"操作失败") duration:2.0 position:@"center"];
                [weakSelf.detectionTypeHeaderView configSelected:!isSelected];
            }
            else{
                weakSelf.deviceInfo.defence = isSelected;
            }
            BOOL isDefence = (weakSelf.deviceInfo.defence != 0);
            [weakSelf updateDetectionView:isDefence];
        }];
    }];
    [self.detectionTypeView didSelectedDetectionType:^(NSString * _Nonnull code) {
        weakSelf.selectedCode = code;
    }];
@@ -108,6 +144,11 @@
    [_header beginRefreshing];
    
    [self.sureButton addTarget:self action:@selector(sureAction) forControlEvents:UIControlEventTouchUpInside];
}
- (void)updateDetectionView:(BOOL)isDefence {
    self.detectionTypeView.hidden = !isDefence;
    self.sureButton.hidden = !isDefence;
}
@@ -150,7 +191,10 @@
- (void)sureAction {
    if (self.selectedCode && self.selectedCode.length > 0) {
        __weak __typeof(self)weakSelf = self;
        __weak MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        hud.labelText = NSLocalizedString(@"setting_switching", @"正在切换,请稍候...");
        [[EZHttpUtil sharedManager] setAiSupportDetection:self.deviceInfo.deviceSerial code:self.selectedCode completion:^(ResponseData * _Nonnull responseData) {
            [hud hide:YES];
            if (responseData.success) {
                [weakSelf.view makeToast:HDLEZLocallizedString(@"setting_opration_success")
                                duration:1.5
@@ -166,6 +210,14 @@
}
#pragma mark - Getter
- (HDLESDetectionTypeHeaderView *)detectionTypeHeaderView {
    if (!_detectionTypeHeaderView) {
        _detectionTypeHeaderView = [[HDLESDetectionTypeHeaderView alloc] init];
        _detectionTypeHeaderView.backgroundColor = [UIColor whiteColor];
    }
    return _detectionTypeHeaderView;
}
- (HDLEZDetectionTypeView *)detectionTypeView {
    if (!_detectionTypeView) {
        _detectionTypeView = [[HDLEZDetectionTypeView alloc] init];
EZSDK/EZSDK/EZ/TempPassword/Views/HDLESDetectionTypeHeaderView.h
New file
@@ -0,0 +1,20 @@
//
//  HDLESDetectionTypeHeaderView.h
//  EZSDK
//
//  Created by Davin on 2024/12/17.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface HDLESDetectionTypeHeaderView : UIView
- (void)configSelected:(BOOL)isSelected;
- (void)configSelected:(BOOL)isSelected switchResult:(void(^)(BOOL isSelected))result;
@end
NS_ASSUME_NONNULL_END
EZSDK/EZSDK/EZ/TempPassword/Views/HDLESDetectionTypeHeaderView.m
New file
@@ -0,0 +1,90 @@
//
//  HDLESDetectionTypeHeaderView.m
//  EZSDK
//
//  Created by Davin on 2024/12/17.
//
#import "HDLESDetectionTypeHeaderView.h"
@interface HDLESDetectionTypeHeaderView ()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UISwitch *detectionSwitch;
@property (nonatomic, copy)void(^switchBlock)(BOOL isSelected);
@end
@implementation HDLESDetectionTypeHeaderView
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self createSubviews];
    }
    return self;
}
- (void)createSubviews {
    [self addSubview:self.titleLabel];
    [self addSubview:self.detectionSwitch];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left).offset(16);
        make.centerY.mas_equalTo(self.mas_centerY);
    }];
    [self.detectionSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_greaterThanOrEqualTo(self.titleLabel.mas_right).offset(16);
        make.right.mas_equalTo(self.mas_right);
        make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
        make.width.mas_equalTo(70);
        make.height.mas_equalTo(28);
    }];
    [self.detectionSwitch addTarget:self action:@selector(detectionSwitchAction:) forControlEvents:UIControlEventValueChanged];
}
#pragma mark - PublishMethod
- (void)configSelected:(BOOL)isSelected {
    [self.detectionSwitch setOn:isSelected];
}
/// 检测信息设置
/// - Parameters:
///   - detectionType: 检测类型
///   - isSelected: 是否选中
- (void)configSelected:(BOOL)isSelected switchResult:(void(^)(BOOL isSelected))result {
    self.switchBlock = result;
    [self.detectionSwitch setOn:isSelected];
}
#pragma mark - PrivateMethod
- (void)detectionSwitchAction:(UISwitch *)sender {
    if (self.switchBlock) {
        self.switchBlock(sender.isOn);
    }
}
#pragma mark - Getter
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel=[[UILabel alloc] init];
        _titleLabel.font = HDLEZ_Get_FontRegularWithSize(HDLEZ_FontSize_14);
        _titleLabel.textColor=HDLEZ_COLOR_TITLE_BLACK;
        _titleLabel.text = NSLocalizedString(@"setting_action_detect", @"活动检测提醒");
    }
    return _titleLabel;
}
- (UISwitch *)detectionSwitch {
    if (!_detectionSwitch) {
        _detectionSwitch = [[UISwitch alloc] initWithFrame:CGRectZero];
        _detectionSwitch.on = NO;
    }
    return _detectionSwitch;
}
@end
EZSDK/EZSDK/EZ/UIViewControllers/EZSettingViewController.m
@@ -784,8 +784,11 @@
}
- (void)mirrorFlipAction {
    __weak MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    __weak __typeof(self)weakSelf = self;
    [[EZHttpUtil sharedManager] setPtzMiroor:self.deviceInfo.deviceSerial command:self.mirrorFlipCommand completion:^(ResponseData * _Nonnull responseData) {
        NSLog(@"#######设置镜像翻转值返回结果:%@", [responseData yy_modelToJSONString]);
        [hud hide:YES];
        if (responseData.success) {
            [UIView dd_showMessage:NSLocalizedString(@"api_mirror_flip_success", @"画面翻转成功")];
        } else {