萤石云 iOSSDK,移植跨平台相关工程
Demo/EZOpensdk_iOS_4.15.1_build20201104/Demo/EZOpenSDKDemo/ViewController.m
@@ -49,11 +49,31 @@
//    //push摄像头列表的viewController
//    [self.navigationController pushViewController:instanceVC animated:YES];
    
    [[GlobalKit shareKit] setAccessToken:@"ra.b48ex6o495x0etj76a0a3huh1x91ymvw-8oi8f811ry-15pqyvo-dyuk9nyz4"];
    /**
     *  下面代码功能与以上的注释方法相同
     */
    [self performSegueWithIdentifier:@"go2CameraList" sender:nil];
//    [[GlobalKit shareKit] setAccessToken:@"ra.b48ex6o495x0etj76a0a3huh1x91ymvw-8oi8f811ry-15pqyvo-dyuk9nyz4"];
//    /**
//     *  下面代码功能与以上的注释方法相同
//     */
//    [self performSegueWithIdentifier:@"go2CameraList" sender:nil];
    [EZSDK setHDlAccessToken:@"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI5MDdhMzhkOTcyZjg0YmQ4YmY0NGM2OTczZGU2ZDU0OCIsInJvbGUiOiIiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidXNlckFjY291bnQiOiIxODgyNDg2NDE0MyIsInRlbmFudElkIjoiMjAiLCJ1c2VyVHlwZSI6IlVTRVJfQyIsInRva2VuVHlwZSI6ImFjY2Vzc190b2tlbiIsInVzZXJOYW1lIjoiTEUwMDAiLCJhcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzMjg4ODYyNzMwMDM4NTU4NzQiLCJleHAiOjE2MTUyODgyMjEsIm5iZiI6MTYxNTI4MTAyMX0.HsVLWNUozTxFcXuQ1ljT_7P4wCzmbV3i4elbQzpWgi6hGWyrgvFi7yiD5sedSwygE8wwvujD342VunG_nDcttLtBijdcKfbiteOgttk-1HlWkny4xAhiRgFeJ3hQnLuH9QDnF1qiznFe_pwy8l41P-gM-WkxKGv7TlX3TPfzC5g" refreshToken:@"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI5MjRhOWMzNGIwNDA0MGE4OGQ2OGNkNGI5NzllZGUxMiIsImhlYWRlclByZWZpeCI6IkJlYXJlciAiLCJ0ZW5hbnRJZCI6IjIwIiwidG9rZW5UeXBlIjoicmVmcmVzaF90b2tlbiIsImFwcGxpY2F0aW9uSWQiOiIwIiwidXNlcklkIjoiMTMyODg4NjI3MzAwMzg1NTg3NCIsImV4cCI6MTYxNTg4NTgyMSwibmJmIjoxNjE1MjgxMDIxfQ.VCwNcWPG5e--3JxLwoO6__vwZEcR_nAP_jTZKYYa2uhruHMhKUat2WYabiU6hofAp9KYKayqI7A24fbl2OrejVoJa_2s5zHkK7vVayo44u8J4aiw0m7YcfH_bzaz45pHhxAG2hKHm-3e95FqBTuKu3eP5m7YO-0HqQA9crRtELU"];
    [EZSDK setRequestHttpsHost:@"https://test-gz.hdlcontrol.com"];
    __weak MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.labelText = NSLocalizedString(@"ad_adding_msg", @"正在添加,请稍候...");
    [EZHttpUtil.sharedManager  getChildToken:^(NSString *accessToken) {
        [hud hide:YES];
        if(accessToken != NULL && ![accessToken isEqual:@""]){
            [[GlobalKit shareKit] setAccessToken:accessToken];
            /**
             *  下面代码功能与以上的注释方法相同
             */
            [self performSegueWithIdentifier:@"go2CameraList" sender:nil];
        }
    }];
}
- (IBAction)logout:(id)sender
@@ -62,20 +82,7 @@
//    [EZOPENSDK logout:^(NSError *error) {
//    }];
    
    __weak MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    [EZSDK addDeviceByHDL:@"" verifyCode:@"" completion:^(NSError *error) {
        [hud hide:YES];
        if(!error){
            NSLog(@"请求成功");
        }else{
            NSLog(@"请求失败");
//            NSLog(@"请求失败%@",error.description);
        }
        [self handleTheError:error];
    }];
}
- (void)handleTheError:(NSError *)error